Skip to content

Commit 7038824

Browse files
committed
feat(rebound): remove unnecessary primary color
1 parent 5dcaabb commit 7038824

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/components/ReboundSection.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ type Props = {
99
bottomHeight?: number;
1010
position?: 'top' | 'bottom' | 'both';
1111
flip?: 'top' | 'bottom' | 'both' | 'none';
12-
primaryColor?: string;
1312
as?: ElementType;
1413
};
1514

@@ -20,14 +19,10 @@ export function ReboundSection({
2019
bottomRebound,
2120
height,
2221
bottomHeight,
23-
primaryColor,
2422
position = 'top',
2523
flip = 'none',
2624
...props
2725
}: Props & HTMLProps<HTMLElement>) {
28-
const baseStyles = css`
29-
background-color: ${primaryColor ?? '#000000'};
30-
`;
3126
const polygon = [
3227
position === 'top' ? '0 100%' : flip !== 'none' && flip !== 'bottom' ? `0 100%` : `0 calc(100% - ${bottomHeight ?? height}px)`,
3328
position === 'top'
@@ -48,5 +43,5 @@ export function ReboundSection({
4843
`;
4944

5045
// eslint-disable-next-line react/jsx-props-no-spreading
51-
return <Section css={[baseStyles, styles, externalStyles]} {...props} />;
46+
return <Section css={[styles, externalStyles]} {...props} />;
5247
}

stories/ReboundSection.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ export function Basic({ rebound, bottomRebound, height, bottomHeight, primaryCol
6565
bottomRebound={bottomRebound}
6666
height={height}
6767
bottomHeight={bottomHeight}
68-
primaryColor={primaryColor}
6968
position={position}
7069
flip={flip}
7170
css={css`
71+
background-color: ${primaryColor};
7272
color: #fff;
7373
margin-top: -${height}px;
7474
margin-bottom: -${bottomHeight}px;
@@ -124,11 +124,11 @@ export function BackgroundImages({
124124
bottomRebound={bottomRebound}
125125
height={height}
126126
bottomHeight={bottomHeight}
127-
primaryColor={primaryColor}
128127
position={position}
129128
flip={flip}
130129
css={css`
131130
color: #fff;
131+
background-color: ${primaryColor};
132132
background-image: url(./res/photo.jpg);
133133
background-size: cover;
134134
background-position: center;

0 commit comments

Comments
 (0)