💄 Add custom font sizing for app name (#1341)
* 💄 Add custom font sizing for app name * 🚸 Added maximum font size
This commit is contained in:
@@ -54,6 +54,10 @@
|
|||||||
"text": "This may take a few seconds"
|
"text": "This may take a few seconds"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"appNameFontSize":{
|
||||||
|
"label":"App Name Font Size",
|
||||||
|
"description":"Set the font size for when the app name is shown on the tile."
|
||||||
|
},
|
||||||
"appNameStatus":{
|
"appNameStatus":{
|
||||||
"label":"App Name Status",
|
"label":"App Name Status",
|
||||||
"description":"Choose where you want the title to show up, if at all.",
|
"description":"Choose where you want the title to show up, if at all.",
|
||||||
|
|||||||
@@ -67,6 +67,16 @@ export const AppearanceTab = ({
|
|||||||
/>
|
/>
|
||||||
{form.values.appearance.appNameStatus === 'normal' && (
|
{form.values.appearance.appNameStatus === 'normal' && (
|
||||||
<>
|
<>
|
||||||
|
<NumberInput
|
||||||
|
label={t('appearance.appNameFontSize.label')}
|
||||||
|
description={t('appearance.appNameFontSize.description')}
|
||||||
|
min={5}
|
||||||
|
max={64}
|
||||||
|
{...form.getInputProps('appearance.appNameFontSize')}
|
||||||
|
onChange={(value) => {
|
||||||
|
form.setFieldValue('appearance.appNameFontSize', value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<Select
|
<Select
|
||||||
label={t('appearance.positionAppName.label')}
|
label={t('appearance.positionAppName.label')}
|
||||||
description={t('appearance.positionAppName.description')}
|
description={t('appearance.positionAppName.description')}
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ export const AvailableElementTypes = ({
|
|||||||
appearance: {
|
appearance: {
|
||||||
iconUrl: '/imgs/logo/logo.png',
|
iconUrl: '/imgs/logo/logo.png',
|
||||||
appNameStatus: 'normal',
|
appNameStatus: 'normal',
|
||||||
|
appNameFontSize: 16,
|
||||||
positionAppName: 'column',
|
positionAppName: 'column',
|
||||||
lineClampAppName: 1,
|
lineClampAppName: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export const AppTile = ({ className, app }: AppTileProps) => {
|
|||||||
<Text
|
<Text
|
||||||
className={cx(classes.appName, 'dashboard-tile-app-title')}
|
className={cx(classes.appName, 'dashboard-tile-app-title')}
|
||||||
fw={700}
|
fw={700}
|
||||||
size="md"
|
size={app.appearance.appNameFontSize}
|
||||||
ta="center"
|
ta="center"
|
||||||
sx={{
|
sx={{
|
||||||
flex: isRow ? '1' : undefined,
|
flex: isRow ? '1' : undefined,
|
||||||
@@ -60,19 +60,12 @@ export const AppTile = ({ className, app }: AppTileProps) => {
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<motion.img
|
<motion.img
|
||||||
className={cx('dashboard-tile-app-image')}
|
className={cx(classes.appImage, 'dashboard-tile-app-image')}
|
||||||
src={app.appearance.iconUrl}
|
src={app.appearance.iconUrl}
|
||||||
height="85%"
|
|
||||||
width="85%"
|
|
||||||
alt={app.name}
|
alt={app.name}
|
||||||
whileHover={{ scale: 0.9 }}
|
whileHover={{ scale: 0.9 }}
|
||||||
initial={{ scale: 0.8 }}
|
initial={{ scale: 0.8 }}
|
||||||
style={{
|
style={{
|
||||||
maxHeight: '90%',
|
|
||||||
maxWidth: '90%',
|
|
||||||
flex: 1,
|
|
||||||
overflow: 'auto',
|
|
||||||
objectFit: 'contain',
|
|
||||||
width: isRow ? 0 : undefined,
|
width: isRow ? 0 : undefined,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -118,6 +111,13 @@ const useStyles = createStyles((theme, _params, getRef) => ({
|
|||||||
overflow: 'visible',
|
overflow: 'visible',
|
||||||
flexGrow: 5,
|
flexGrow: 5,
|
||||||
},
|
},
|
||||||
|
appImage:{
|
||||||
|
maxHeight: '100%',
|
||||||
|
maxWidth: '100%',
|
||||||
|
overflow: 'auto',
|
||||||
|
flex: 1,
|
||||||
|
objectFit: 'contain',
|
||||||
|
},
|
||||||
appName: {
|
appName: {
|
||||||
wordBreak: 'break-word',
|
wordBreak: 'break-word',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
|
|||||||
appearance: {
|
appearance: {
|
||||||
iconUrl: '/imgs/logo/logo.png',
|
iconUrl: '/imgs/logo/logo.png',
|
||||||
appNameStatus: 'normal',
|
appNameStatus: 'normal',
|
||||||
|
appNameFontSize: 16,
|
||||||
positionAppName: 'column',
|
positionAppName: 'column',
|
||||||
lineClampAppName: 1,
|
lineClampAppName: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ const migrateAppConfigs = (config: BackendConfigType) => {
|
|||||||
...app.appearance,
|
...app.appearance,
|
||||||
appNameStatus: app.appearance.appNameStatus?? 'normal',
|
appNameStatus: app.appearance.appNameStatus?? 'normal',
|
||||||
positionAppName: app.appearance.positionAppName?? 'column',
|
positionAppName: app.appearance.positionAppName?? 'column',
|
||||||
|
appNameFontSize: app.appearance.appNameFontSize?? 16,
|
||||||
lineClampAppName: app.appearance.lineClampAppName?? 1,
|
lineClampAppName: app.appearance.lineClampAppName?? 1,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ interface AppAppearanceType {
|
|||||||
iconUrl: string;
|
iconUrl: string;
|
||||||
appNameStatus: "normal"|"hover"|"hidden";
|
appNameStatus: "normal"|"hover"|"hidden";
|
||||||
positionAppName: Property.FlexDirection;
|
positionAppName: Property.FlexDirection;
|
||||||
|
appNameFontSize: number;
|
||||||
lineClampAppName: number;
|
lineClampAppName: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user