Skip to content

Commit 1dd978a

Browse files
committed
added props complete based disabledState component changes
1 parent ca042bf commit 1dd978a

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

src/pages/sidepanel/State.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { DisabledState } from '@root/src/pages/sidepanel/components/DisabledStat
66
import { WrongDomain } from '@root/src/pages/sidepanel/assets/svg/wrongDomainIcon';
77
import useStorage from '@src/shared/hooks/useStorage';
88
import { useDisabledState } from '@root/src/pages/sidepanel/hooks/useDisabledState';
9+
import { appContent } from '@root/src/shared/content/appContent';
910
import extensionStateStorage from '@src/shared/storages/extensionStateStorage';
1011
import SidePanel from '@pages/sidepanel/SidePanel';
1112

@@ -142,7 +143,16 @@ const State: React.FC<React.PropsWithChildren<StateProps>> = () => {
142143
)}
143144
</Box>
144145
) : (
145-
<DisabledState documentationUrl={documentationUrl} onDocLinkClick={handleDocClick} />
146+
<DisabledState
147+
documentationUrl={documentationUrl}
148+
onDocLinkClick={handleDocClick}
149+
toggleLabel={appContent.disabledState.toggleLabel}
150+
title={appContent.disabledState.title}
151+
description={appContent.disabledState.description}
152+
documentationText={appContent.disabledState.documentationText}
153+
documentationLinkText={appContent.disabledState.documentationLinkText}
154+
documentationSuffix={appContent.disabledState.documentationSuffix}
155+
/>
146156
)}
147157
</Box>
148158
);

src/pages/sidepanel/components/DisabledState.tsx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ import { styled } from '@mui/material/styles';
44
import Toggle from '@root/src/pages/sidepanel/components/Toggle';
55
import { ArrowPointer } from '@root/src/pages/sidepanel/assets/svg/ArrowPointer';
66
import { appColors } from '@root/src/theme/palette';
7-
import { appContent } from '@root/src/shared/content/appContent';
87

98
interface DisabledStateProps {
109
documentationUrl: string;
1110
onDocLinkClick: (e: React.MouseEvent<HTMLAnchorElement>) => void;
11+
toggleLabel: string;
12+
title: string;
13+
description: string;
14+
documentationText: string;
15+
documentationLinkText: string;
16+
documentationSuffix: string;
1217
}
1318

1419
const Container = styled(Stack)(({ theme }) => ({
@@ -136,7 +141,16 @@ const StyledLink = styled(Link)(() => ({
136141
},
137142
}));
138143

139-
export const DisabledState = ({ documentationUrl, onDocLinkClick }: DisabledStateProps): JSX.Element => {
144+
export const DisabledState = ({
145+
documentationUrl,
146+
onDocLinkClick,
147+
toggleLabel,
148+
title,
149+
description,
150+
documentationText,
151+
documentationLinkText,
152+
documentationSuffix,
153+
}: DisabledStateProps): JSX.Element => {
140154
return (
141155
<Container>
142156
<OuterCard>
@@ -145,7 +159,7 @@ export const DisabledState = ({ documentationUrl, onDocLinkClick }: DisabledStat
145159
<ArrowPointer aria-hidden="true" />
146160

147161
<ToggleCard>
148-
<ToggleText>{appContent.disabledState.toggleLabel}</ToggleText>
162+
<ToggleText>{toggleLabel}</ToggleText>
149163
<SwitchWrapper>
150164
<Toggle checked disabled />
151165
</SwitchWrapper>
@@ -155,10 +169,10 @@ export const DisabledState = ({ documentationUrl, onDocLinkClick }: DisabledStat
155169
<StyledCard>
156170
<Stack spacing={1} alignItems="center" textAlign="center">
157171
<Title variant="h6" align="center">
158-
{appContent.disabledState.title}
172+
{title}
159173
</Title>
160174
<Description variant="body2" color="text.secondary" align="center">
161-
{appContent.disabledState.description}
175+
{description}
162176
</Description>
163177
</Stack>
164178
</StyledCard>
@@ -167,11 +181,11 @@ export const DisabledState = ({ documentationUrl, onDocLinkClick }: DisabledStat
167181

168182
<DocCard>
169183
<DocText variant="body2" color="text.secondary" align="center">
170-
{appContent.disabledState.documentationText}{' '}
184+
{documentationText}{' '}
171185
<StyledLink variant="body2" href={documentationUrl} target="_blank" onClick={onDocLinkClick}>
172-
{appContent.disabledState.documentationLinkText}
186+
{documentationLinkText}
173187
</StyledLink>
174-
{appContent.disabledState.documentationSuffix}
188+
{documentationSuffix}
175189
</DocText>
176190
</DocCard>
177191
</Container>

0 commit comments

Comments
 (0)