Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/components/Organisms/DonateBanner/DonateBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,13 @@ const DonateBanner = ({
)}

<Wrapper
donateOrientation={donateOrientation}
aria-live="polite"
noTitlesAtAll={noTitlesAtAll}
hasTopImage={shouldRenderTopImage}
shouldShowTitleSection={shouldShowTitleSection}
showTitleSection={shouldShowTitleSection}
>
{shouldShowTitleSection && (
<TitleWrapperOuter donateOrientation={donateOrientation}>
<TitleWrapperOuter $orientation={donateOrientation}>
<TitleWrapperInner>
{showCopy && (
<>
Expand Down
122 changes: 10 additions & 112 deletions src/components/Organisms/DonateBanner/DonateBanner.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,112 +5,17 @@ import Text from '../../Atoms/Text/Text';
import spacing from '../../../theme/shared/spacing';
import zIndex from '../../../theme/shared/zIndex';
import defaultBoxShadow from '../../../theme/shared/boxShadows';
import { playPauseReveal } from '../../../theme/shared/animations';

const Container = styled.div`
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: auto;
background-color: ${({ theme, pageBackgroundColour }) => theme.color(pageBackgroundColour)};
width: 100%;
padding: ${({ paddingAbove, paddingBelow }) => `${paddingAbove} ${spacing('md')} ${paddingBelow} ${spacing('md')}`};
@media ${({ theme }) => theme.allBreakpoints('M')} {
padding: ${({ paddingAbove, paddingBelow }) => `${paddingAbove} ${spacing('l')} ${paddingBelow} ${spacing('l')}`};
}
`;

const InnerContainer = styled.div`
position: relative;
background-color: ${({ theme, componentBackgroundColour }) => theme.color(componentBackgroundColour)};
border-radius: 1rem;
overflow: hidden;
padding: none;
width: 100%;
box-sizing: border-box;
${defaultBoxShadow()}

@media ${({ theme }) => theme.allBreakpoints('L')} {
min-height: 700px;
display: flex;
flex-direction: column;
justify-content: center;
max-width: 1500px;
margin-left: auto;
margin-right: auto;

${playPauseReveal}
`;

const Wrapper = styled.div`
position: relative;
text-align: center;
align-items: center;
display: block;
width: 100%;
max-width: 1216px;
margin-left: auto;
margin-right: auto;

${({ hasTopImage, shouldShowTitleSection }) => hasTopImage && !shouldShowTitleSection && css`
padding: 0;
`}

${({ noTitlesAtAll }) => noTitlesAtAll === true && css`
justify-content: center;
`};


@media ${({ theme }) => theme.allBreakpoints('L')} {
display: flex;
padding: ${spacing('l')};
gap: ${spacing('l')};
flex-direction: row;
}
`;

const TitleWrapperOuter = styled.div`
width: 100%;
display: flex;
font-family: ${({ theme }) => theme.fontFamilies(theme.font.regular)};
padding-bottom: ${spacing('l')};
@media ${({ theme }) => theme.allBreakpoints('L')} {
flex: 1 1 0;
width: auto;
padding: 0;
align-items: center;
order: ${({ donateOrientation }) => (donateOrientation === 'left' ? 2 : 1)};
}
`;

const TitleWrapperInner = styled.div`
position: relative;
text-align: left;
`;

const FormWrapper = styled.div`
position: relative;
font-family: ${({ theme }) => theme.fontFamilies(theme.font.regular)};
@media ${({ theme }) => theme.allBreakpoints('L')} {
flex: 1 1 0;
min-width: 0;
width: auto;
display: flex;
justify-content: ${({ donateOrientation }) => (
donateOrientation === 'left' ? 'flex-start' : 'flex-end'
)};
order: ${({ donateOrientation }) => (donateOrientation === 'left' ? 1 : 2)};
}
`;

const Error = styled(Text)`
color: ${({ theme }) => theme.color('red')};
font-size: ${({ theme }) => theme.fontSize('s')};
font-weight: 500;
margin-top: ${spacing('l')};
`;
import {
Container,
InnerContainer,
Wrapper,
TitleWrapperOuter,
TitleWrapperInner,
FormWrapper,
Error,
FormFieldset
} from '../shared/Banner.styles';

const Form = styled.form`
position: relative;
Expand Down Expand Up @@ -210,13 +115,6 @@ const MoneyBuys = styled.div`
}
`;

const FormFieldset = styled.div`
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
`;

const Label = styled(Text)`
margin-bottom: ${spacing('sm')};
`;
Expand Down
6 changes: 1 addition & 5 deletions src/components/Organisms/DonateBanner/Form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,8 @@ const Signup = ({
const titleTag = donateWidgetIsTextOnly ? 'h1' : 'p';

return (
<FormWrapper
donateOrientation={donateOrientation}
shouldShowTitleSection={shouldShowTitleSection}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realised I didn't need this line, styles don't use it

>
<FormWrapper $orientation={donateOrientation}>
<Form
donateOrientation={donateOrientation}
hasTopImage={hasTopImage}
shouldShowTitleSection={shouldShowTitleSection}
onSubmit={e => submitDonation(
Expand Down
Loading