💄 Styling and responsiveness

Co-authored-by: Walkx <walkxnl@gmail.com>
This commit is contained in:
Aj - Thomas
2022-05-15 22:55:02 +02:00
committed by ajnart
parent 4045628166
commit c5178ee288
6 changed files with 45 additions and 69 deletions

View File

@@ -1,6 +1,6 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { Text, AspectRatio, SimpleGrid, Card, Image, useMantineTheme } from '@mantine/core'; import { Text, AspectRatio, Card, Image, useMantineTheme, Center, Grid } from '@mantine/core';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { serviceItem } from '../../tools/types'; import { serviceItem } from '../../tools/types';
import AppShelfMenu from './AppShelfMenu'; import AppShelfMenu from './AppShelfMenu';
@@ -9,22 +9,13 @@ const AppShelf = () => {
const { config } = useConfig(); const { config } = useConfig();
return ( return (
<SimpleGrid <Grid gutter="xl" align="center">
cols={7}
spacing="xl"
breakpoints={[
{ maxWidth: 2400, cols: 6, spacing: 'xl' },
{ maxWidth: 1800, cols: 5, spacing: 'xl' },
{ maxWidth: 1500, cols: 4, spacing: 'lg' },
{ maxWidth: 800, cols: 3, spacing: 'md' },
{ maxWidth: 400, cols: 3, spacing: 'sm' },
{ maxWidth: 400, cols: 2, spacing: 'sm' },
]}
>
{config.services.map((service) => ( {config.services.map((service) => (
<Grid.Col span={6} xs={4} sm={3} md={2}>
<AppShelfItem key={service.name} service={service} /> <AppShelfItem key={service.name} service={service} />
</Grid.Col>
))} ))}
</SimpleGrid> </Grid>
); );
}; };
@@ -68,6 +59,7 @@ export function AppShelfItem(props: any) {
<AppShelfMenu service={service} /> <AppShelfMenu service={service} />
</motion.div> </motion.div>
</Card.Section> </Card.Section>
<Center>
<Card.Section> <Card.Section>
<AspectRatio <AspectRatio
ratio={3 / 5} ratio={3 / 5}
@@ -84,18 +76,18 @@ export function AppShelfItem(props: any) {
}} }}
> >
<Image <Image
style={{ width={80}
maxWidth: 80, height={80}
}} src={service.icon}
fit="contain" fit="contain"
onClick={() => { onClick={() => {
window.open(service.url); window.open(service.url);
}} }}
src={service.icon}
/> />
</motion.i> </motion.i>
</AspectRatio> </AspectRatio>
</Card.Section> </Card.Section>
</Center>
</Card> </Card>
</motion.div> </motion.div>
); );

View File

@@ -22,7 +22,7 @@ export default function SearchBar(props: any) {
return ( return (
<Box <Box
mb={"xl"} mb="xl"
style={{ style={{
width: '100%', width: '100%',
}} }}
@@ -81,7 +81,8 @@ export default function SearchBar(props: any) {
} }
> >
<Text> <Text>
tip: Use the prefixes <b>!yt</b> and <b>!t</b> in front of your query to search on YouTube or for a Torrent respectively. tip: Use the prefixes <b>!yt</b> and <b>!t</b> in front of your query to search on
YouTube or for a Torrent respectively.
</Text> </Text>
</Popover> </Popover>
</form> </form>

View File

@@ -55,23 +55,11 @@ export function Footer({ links }: FooterCenteredProps) {
)); ));
return ( return (
<FooterComponent height="auto" style={{ border: 'none' }}> <FooterComponent p={5} height="auto" style={{ border: 'none', position: 'fixed', bottom: 0, right: 0 }}>
<Group <Group position="right" mr="xs" mb="xs">
sx={{
position: 'fixed',
bottom: 0,
right: 15,
}}
direction="row"
align="center"
mb={15}
>
<Group className={classes.links}>{items}</Group>
<Group spacing="xs" position="right" noWrap>
<ActionIcon<'a'> component="a" href="https://github.com/ajnart/homarr" size="lg"> <ActionIcon<'a'> component="a" href="https://github.com/ajnart/homarr" size="lg">
<BrandGithub size={18} /> <BrandGithub size={18} />
</ActionIcon> </ActionIcon>
</Group>
<Text <Text
style={{ style={{
fontSize: '0.90rem', fontSize: '0.90rem',

View File

@@ -6,9 +6,6 @@ import Navbar from './Navbar';
const useStyles = createStyles((theme) => ({ const useStyles = createStyles((theme) => ({
main: { main: {
[theme.fn.largerThan('md')]: {
maxWidth: 1500,
},
}, },
})); }));
@@ -21,7 +18,6 @@ export default function Layout({ children, style }: any) {
header={<Header links={[]} />} header={<Header links={[]} />}
footer={<Footer links={[]} />} footer={<Footer links={[]} />}
> >
<Center>
<main <main
className={cx(classes.main)} className={cx(classes.main)}
style={{ style={{
@@ -30,7 +26,6 @@ export default function Layout({ children, style }: any) {
> >
{children} {children}
</main> </main>
</Center>
</AppShell> </AppShell>
); );
} }

View File

@@ -14,7 +14,7 @@ export default function Navbar() {
base: 'auto', base: 'auto',
}} }}
> >
<Group mt="sm" direction="column"> <Group mt="sm" direction="column" align="center">
<ModuleWrapper module={DateModule} /> <ModuleWrapper module={DateModule} />
</Group> </Group>
</MantineNavbar> </MantineNavbar>

View File

@@ -54,7 +54,7 @@ export default function HomePage(props: any) {
}, [initialConfig]); }, [initialConfig]);
return ( return (
<> <>
<SearchBar /> <SearchBar style={{ width: '100%'}} />
<Group align="start" position="apart" noWrap> <Group align="start" position="apart" noWrap>
<AppShelf /> <AppShelf />
</Group> </Group>