Add propagation for service name to service icon

This commit is contained in:
Manuel Ruwe
2022-12-11 19:32:51 +01:00
parent ed64d138c5
commit 05e47b5664
7 changed files with 97 additions and 74 deletions

View File

@@ -7,9 +7,15 @@ import { IconSelector } from './IconSelector/IconSelector';
interface AppearanceTabProps {
form: UseFormReturnType<ServiceType, (values: ServiceType) => ServiceType>;
disallowServiceNameProgagation: () => void;
allowServiceNamePropagation: boolean;
}
export const AppearanceTab = ({ form }: AppearanceTabProps) => {
export const AppearanceTab = ({
form,
disallowServiceNameProgagation,
allowServiceNamePropagation,
}: AppearanceTabProps) => {
const { t } = useTranslation('');
const { classes } = useStyles();
@@ -28,13 +34,16 @@ export const AppearanceTab = ({ form }: AppearanceTabProps) => {
{...form.getInputProps('appearance.iconUrl')}
/>
<IconSelector
onChange={(item) =>
onChange={(item) => {
form.setValues({
appearance: {
iconUrl: item.url,
},
})
}
});
disallowServiceNameProgagation();
}}
allowServiceNamePropagation={allowServiceNamePropagation}
form={form}
/>
</Flex>
</Tabs.Panel>