diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 0e47bd6..54957ae 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -110,6 +110,10 @@ }, "AliasesRoute": { "title": "Aliases", + "emptyState": { + "title": "Welcome to your Aliases!", + "description": "Create your first Alias to get started." + }, "pageActions": { "search": { "label": "Search", @@ -214,7 +218,8 @@ "forms": { "aliasPreferences": { "title": "Alias Preferences", - "description": "Select the default behavior for your aliases. This will only affect aliases that do not have a custom behavior set." + "description": "Select the default behavior for your aliases. This will only affect aliases that do not have a custom behavior set.", + "saveAction": "Save preferences" } } } diff --git a/src/apis/create-alias.ts b/src/apis/create-alias.ts index 4ecfc1d..0871aa2 100644 --- a/src/apis/create-alias.ts +++ b/src/apis/create-alias.ts @@ -1,9 +1,4 @@ -import { - Alias, - AliasType, - ImageProxyFormatType, - ProxyUserAgentType, -} from "~/server-types" +import {Alias, AliasType, ImageProxyFormatType, ProxyUserAgentType} from "~/server-types" import {client} from "~/constants/axios-client" interface CreateAliasDataOther { @@ -32,20 +27,12 @@ interface CreateAliasDataCustomType extends CreateAliasDataBase { local: string } -export type CreateAliasData = - | CreateAliasDataRandomType - | CreateAliasDataCustomType +export type CreateAliasData = CreateAliasDataRandomType | CreateAliasDataCustomType -export default async function createAlias( - aliasData: CreateAliasData, -): Promise { - const {data} = await client.post( - `${import.meta.env.VITE_SERVER_BASE_URL}/alias`, - aliasData, - { - withCredentials: true, - }, - ) +export default async function createAlias(aliasData: CreateAliasData): Promise { + const {data} = await client.post(`${import.meta.env.VITE_SERVER_BASE_URL}/alias`, aliasData, { + withCredentials: true, + }) return data } diff --git a/src/components/SimpleForm.tsx b/src/components/SimpleForm.tsx index 137deb3..ec1eb8a 100644 --- a/src/components/SimpleForm.tsx +++ b/src/components/SimpleForm.tsx @@ -2,14 +2,7 @@ import {MdChevronRight} from "react-icons/md" import {TiCancel} from "react-icons/ti" import React, {ReactElement, useEffect, useState} from "react" -import { - Alert, - Button, - Grid, - Snackbar, - Typography, - TypographyProps, -} from "@mui/material" +import {Alert, Button, Grid, Snackbar, Typography, TypographyProps} from "@mui/material" import {LoadingButton} from "@mui/lab" import {OverrideProps} from "@mui/types" @@ -52,6 +45,7 @@ export default function SimpleForm({ spacing={4} paddingX={2} paddingY={4} + direction="column" alignItems="center" justifyContent="center" > @@ -85,12 +79,7 @@ export default function SimpleForm({ )} - + {cancelActionLabel && (