Skip to content

Commit 4de0f6a

Browse files
[ShadowBevel] Consolidate conditional logic (#10144)
### WHY are these changes introduced? Fixes #9965 ### WHAT is this pull request doing? Consolidate se23 logic and styles for `ShadowBevel` Component ### How to 🎩 * Compare production and this PR's chromatic storybook to make sure styles are the same * `polarisSummerEditions2023ShadowBevelOptOut` toggle shouldn't do anything now [Production](https://storybook.polaris.shopify.com/?path=/story/all-components-shadowbevel--default&globals=polarisSummerEditions2023:true) [This PR]()
1 parent 210f212 commit 4de0f6a

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

polaris-react/src/components/ShadowBevel/ShadowBevel.stories.tsx

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@ import type {ComponentMeta} from '@storybook/react';
33
import type {BoxProps} from '@shopify/polaris';
44
import {Box, BlockStack, InlineCode} from '@shopify/polaris';
55

6-
import {useFeatures} from '../../utilities/features';
7-
86
import {ShadowBevel} from './ShadowBevel';
97

108
export default {
119
component: ShadowBevel,
1210
} as ComponentMeta<typeof ShadowBevel>;
1311

1412
export function Default() {
15-
const {polarisSummerEditions2023} = useFeatures();
16-
1713
const colors: BoxProps[] = [
1814
{
1915
background: 'bg-success-strong',
@@ -74,18 +70,17 @@ export function Default() {
7470
</Box>
7571
</ShadowBevel>
7672

77-
{polarisSummerEditions2023 &&
78-
colors.map(({background, color}) => (
79-
<ShadowBevel
80-
key={`${background}-${color}`}
81-
boxShadow="md"
82-
borderRadius="3"
83-
>
84-
<Box background={background} color={color} padding="4">
85-
{background}
86-
</Box>
87-
</ShadowBevel>
88-
))}
73+
{colors.map(({background, color}) => (
74+
<ShadowBevel
75+
key={`${background}-${color}`}
76+
boxShadow="md"
77+
borderRadius="3"
78+
>
79+
<Box background={background} color={color} padding="4">
80+
{background}
81+
</Box>
82+
</ShadowBevel>
83+
))}
8984

9085
<br />
9186
</BlockStack>

polaris-react/src/components/ShadowBevel/ShadowBevel.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type {BorderRadiusScale, ShadowAlias} from '@shopify/polaris-tokens';
33

44
import {getResponsiveValue} from '../../utilities/css';
55
import type {ResponsiveProp} from '../../utilities/css';
6-
import {useFeatures} from '../../utilities/features';
76

87
import styles from './ShadowBevel.scss';
98

@@ -34,8 +33,6 @@ export function ShadowBevel(props: ShadowBevelProps) {
3433
zIndex = '0',
3534
} = props;
3635

37-
const {polarisSummerEditions2023ShadowBevelOptOut} = useFeatures();
38-
3936
const Component = as;
4037

4138
return (
@@ -46,13 +43,7 @@ export function ShadowBevel(props: ShadowBevelProps) {
4643
...getResponsiveValue(
4744
'shadow-bevel',
4845
'content',
49-
mapResponsiveProp(bevel, (bevel) => {
50-
if (polarisSummerEditions2023ShadowBevelOptOut) {
51-
return 'none';
52-
}
53-
54-
return bevel ? '""' : 'none';
55-
}),
46+
mapResponsiveProp(bevel, (bevel) => (bevel ? '""' : 'none')),
5647
),
5748
...getResponsiveValue(
5849
'shadow-bevel',

0 commit comments

Comments
 (0)