Skip to content

Commit

Permalink
feat(browser-extension): fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Darran Boyd committed Nov 25, 2024
1 parent f37a9a0 commit e853e9a
Showing 1 changed file with 32 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,36 @@ export interface ConfigDetailViewProps {
}

export const ConfigDetailView: FC<ConfigDetailViewProps> = () => {
const navigate = useNavigate();
const { integrationType } = useParams<{ integrationType: string }>();
const { config, setConfig } = useContext(ExtensionConfigContext);
const integrationConfig = useMemo(() => config.integrations[integrationType!], [integrationType, config]);
const setIntegrationConfig = useCallback((newIntegrationConfig: Partial<IntegrationConfig>) => {
setConfig((prev) => {
return {
...prev, integrations: {
...prev.integrations,
[integrationType!]:
{ ...prev.integrations[integrationType!], ...newIntegrationConfig }
}
};
});
}, [integrationType, setConfig]);
return (
<Form actions={(
<SpaceBetween size="s" direction="horizontal">
<Button onClick={() => {
navigate('/');
}}>Back</Button>
</SpaceBetween>
)}>
<RegexArrayForm placeholder="Regex to apply to URL" strings={integrationConfig.urlRegexes} setStrings={(newRegexes) => { setIntegrationConfig({ urlRegexes: newRegexes }); }}>

</RegexArrayForm>


</Form>

);
const navigate = useNavigate();
const { integrationType } = useParams<{ integrationType: string }>();
const { config, setConfig } = useContext(ExtensionConfigContext);
const integrationConfig = useMemo(() => config.integrations[integrationType!], [integrationType, config]);
const setIntegrationConfig = useCallback((newIntegrationConfig: Partial<IntegrationConfig>) => {
setConfig((prev) => {
return {
...prev,
integrations: {
...prev.integrations,
[integrationType!]:
{ ...prev.integrations[integrationType!], ...newIntegrationConfig },
},
};
});
}, [integrationType, setConfig]);
return (
<Form actions={(
<SpaceBetween size="s" direction="horizontal">
<Button onClick={() => {
navigate('/');
}}>Back</Button>
</SpaceBetween>
)}>
<RegexArrayForm placeholder="Regex to apply to URL" strings={integrationConfig.urlRegexes} setStrings={(newRegexes) => { setIntegrationConfig({ urlRegexes: newRegexes }); }}>

</RegexArrayForm>


</Form>

);
};

0 comments on commit e853e9a

Please sign in to comment.