🌐 Add new tile

This commit is contained in:
Tagaishi
2023-08-13 22:56:41 +02:00
parent a973265795
commit d51bd43941
2 changed files with 22 additions and 8 deletions

View File

@@ -7,5 +7,19 @@
"goBack": "Go back to the previous step", "goBack": "Go back to the previous step",
"actionIcon": { "actionIcon": {
"tooltip": "Add a tile" "tooltip": "Add a tile"
},
"apps": "Apps",
"app": {
"defaultName": "Your App"
},
"widgets": "Widgets",
"categories": "Categories",
"category": {
"newName": "Name of new category",
"defaultName": "New Category",
"created": {
"title": "Category created",
"message": "The category \"{{name}}\" has been created"
}
} }
} }

View File

@@ -33,12 +33,12 @@ export const AvailableElementTypes = ({
const onClickCreateCategory = async () => { const onClickCreateCategory = async () => {
openContextModalGeneric<CategoryEditModalInnerProps>({ openContextModalGeneric<CategoryEditModalInnerProps>({
modal: 'categoryEditModal', modal: 'categoryEditModal',
title: 'Name of new category', title: t('category.newName'),
withCloseButton: false, withCloseButton: false,
innerProps: { innerProps: {
category: { category: {
id: uuidv4(), id: uuidv4(),
name: 'New category', name: t('category.defaultName'),
position: 0, // doesn't matter, is being overwritten position: 0, // doesn't matter, is being overwritten
}, },
onSuccess: async (category) => { onSuccess: async (category) => {
@@ -65,8 +65,8 @@ export const AvailableElementTypes = ({
})).then(() => { })).then(() => {
closeModal(modalId); closeModal(modalId);
showNotification({ showNotification({
title: 'Category created', title: t('category.created.title'),
message: `The category ${category.name} has been created`, message: t('category.created.message', { name: category.name}),
color: 'teal', color: 'teal',
}); });
}); });
@@ -81,7 +81,7 @@ export const AvailableElementTypes = ({
<Space h="lg" /> <Space h="lg" />
<Group spacing="md" grow> <Group spacing="md" grow>
<ElementItem <ElementItem
name="Apps" name={t('apps')}
icon={<IconBox size={40} strokeWidth={1.3} />} icon={<IconBox size={40} strokeWidth={1.3} />}
onClick={() => { onClick={() => {
openContextModalGeneric<{ app: AppType; allowAppNamePropagation: boolean }>({ openContextModalGeneric<{ app: AppType; allowAppNamePropagation: boolean }>({
@@ -89,7 +89,7 @@ export const AvailableElementTypes = ({
innerProps: { innerProps: {
app: { app: {
id: uuidv4(), id: uuidv4(),
name: 'Your app', name: t('app.defaultName'),
url: 'https://homarr.dev', url: 'https://homarr.dev',
appearance: { appearance: {
iconUrl: '/imgs/logo/logo.png', iconUrl: '/imgs/logo/logo.png',
@@ -126,12 +126,12 @@ export const AvailableElementTypes = ({
}} }}
/> />
<ElementItem <ElementItem
name="Widgets" name={t('widgets')}
icon={<IconStack size={40} strokeWidth={1.3} />} icon={<IconStack size={40} strokeWidth={1.3} />}
onClick={onOpenWidgets} onClick={onOpenWidgets}
/> />
<ElementItem <ElementItem
name="Category" name={t('categories')}
icon={<IconBoxAlignTop size={40} strokeWidth={1.3} />} icon={<IconBoxAlignTop size={40} strokeWidth={1.3} />}
onClick={onClickCreateCategory} onClick={onClickCreateCategory}
/> />