Skip to content

Commit

Permalink
fix:desktop modal header style & costcenter breakpoints (#4675)
Browse files Browse the repository at this point in the history
* fix:desktop modal header style

Signed-off-by: jingyang <3161362058@qq.com>

* fix cost center breakpoints

Signed-off-by: jingyang <3161362058@qq.com>

* fix template

---------

Signed-off-by: jingyang <3161362058@qq.com>
  • Loading branch information
zjy365 authored Apr 11, 2024
1 parent aae9e68 commit ac3aeef
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 33 deletions.
6 changes: 4 additions & 2 deletions frontend/desktop/src/components/account/PasswordModify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export default function PasswordModify(props: FlexProps) {
backdropFilter="blur(150px)"
p="24px"
>
<ModalCloseButton right={'24px'} top="24px" p="0" />
<ModalHeader p="0">{t('changePassword')}</ModalHeader>
<ModalCloseButton right={'24px'} top="16px" p="0" />
<ModalHeader bg={'white'} border={'none'} p="0">
{t('changePassword')}
</ModalHeader>
{mutation.isLoading ? (
<Spinner mx={'auto'} />
) : (
Expand Down
6 changes: 4 additions & 2 deletions frontend/desktop/src/components/team/Abdication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ export default function Abdication({
backdropFilter="blur(150px)"
p="24px"
>
<ModalCloseButton right={'24px'} top="24px" p="0" />
<ModalHeader p="0">{t('Abdication')}</ModalHeader>
<ModalCloseButton right={'24px'} top="16px" p="0" />
<ModalHeader bg={'white'} border={'none'} p="0">
{t('Abdication')}
</ModalHeader>
{mutation.isLoading ? (
<Spinner mx="auto" />
) : (
Expand Down
4 changes: 3 additions & 1 deletion frontend/desktop/src/components/team/ModifyRole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export default function ModifyRole({
p="24px"
>
<ModalCloseButton right={'24px'} top="24px" p="0" />
<ModalHeader p="0">modify member</ModalHeader>
<ModalHeader bg={'white'} border={'none'} p="0">
modify member
</ModalHeader>
{mutation.isLoading ? (
<Spinner mx="auto" />
) : (
Expand Down
6 changes: 4 additions & 2 deletions frontend/desktop/src/components/team/ReciveMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ export default function ReciveMessage({
backdropFilter="blur(150px)"
p="24px"
>
<ModalCloseButton right={'24px'} top="24px" p="0" color={'#24282C'} />
<ModalHeader p="0">{t('Accept Invitation')}</ModalHeader>
<ModalCloseButton right={'24px'} top="16px" p="0" color={'#24282C'} />
<ModalHeader bg={'white'} border={'none'} p="0">
{t('Accept Invitation')}
</ModalHeader>
{mutation.isLoading ? (
<Spinner mx={'auto'} />
) : (
Expand Down
11 changes: 6 additions & 5 deletions frontend/packages/ui/src/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ const _theme = {
'2xl': '20px'
},
breakpoints: {
sm: '1024px',
md: '1280px',
lg: '1500px',
xl: '1800px',
'2xl': '2100px'
base: '0px',
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px'
},
fontWeights: {
bold: 500
Expand Down
1 change: 1 addition & 0 deletions frontend/providers/costcenter/src/styles/chakraTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const theme = extendTheme(originTheme, {
Heading,
Card
},
breakpoints: { base: '0em', sm: '30em', md: '48em', lg: '62em', xl: '80em', '2xl': '96em' },
styles: {
global: {
'html, body': {
Expand Down
26 changes: 15 additions & 11 deletions frontend/providers/template/src/components/Banner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSystemConfigStore } from '@/store/config';
import { SlideDataType } from '@/types/app';
import { Box, Center, Flex, Text } from '@chakra-ui/react';
import { Box, Center, Flex, Text, useBreakpointValue } from '@chakra-ui/react';
import { useRouter } from 'next/router';
import React, { useRef } from 'react';
import 'swiper/css';
Expand Down Expand Up @@ -58,6 +58,7 @@ export default React.memo(function Banner() {
const swiperRef = useRef<SwiperRef>(null);
const { systemConfig } = useSystemConfigStore();
const router = useRouter();
const isSmallScreen = useBreakpointValue({ base: true, xl: false });

const handlePrev = () => {
if (swiperRef.current) {
Expand All @@ -83,7 +84,7 @@ export default React.memo(function Banner() {

return (
<Box
minW={'960px'}
minW={'480px'}
h="213px"
mb="24px"
position={'relative'}
Expand Down Expand Up @@ -111,19 +112,22 @@ export default React.memo(function Banner() {
<SwiperSlide key={index}>
<Flex w="full" h="213px" gap={'16px'} overflow={'hidden'}>
<Card item={item} onClick={() => goDeploy(item.templateName)} />
<Card
item={systemConfig?.slideData[(index + 1) % systemConfig?.slideData.length]}
onClick={() =>
goDeploy(
(systemConfig?.slideData[(index + 1) % systemConfig?.slideData.length])
.templateName
)
}
/>
{!isSmallScreen && (
<Card
item={systemConfig?.slideData[(index + 1) % systemConfig?.slideData.length]}
onClick={() =>
goDeploy(
(systemConfig?.slideData[(index + 1) % systemConfig?.slideData.length])
.templateName
)
}
/>
)}
</Flex>
</SwiperSlide>
))}
</Swiper>

<Box
transition="opacity 0.3s"
opacity={0}
Expand Down
6 changes: 3 additions & 3 deletions frontend/providers/template/src/components/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Box, Grid } from '@chakra-ui/react';
import { Box, Grid, useBreakpointValue } from '@chakra-ui/react';
import { useRouter } from 'next/router';

import dynamic from 'next/dynamic';

const ShowLayoutRoute: Record<string, boolean> = {
Expand All @@ -16,12 +15,13 @@ const AppMenu = dynamic(() => import('./appmenu'), {

export default function Layout({ children }: { children: JSX.Element }) {
const router = useRouter();
const firstColumnWidth = useBreakpointValue({ base: '230px', xl: '270px' });

return (
<>
{ShowLayoutRoute[router.pathname] ? (
<Grid
templateColumns={'270px 1fr'}
templateColumns={`${firstColumnWidth} 1fr`}
h="100vh"
overflow={'hidden'}
background={'rgba(150, 153, 180, 0.15)'}
Expand Down
11 changes: 6 additions & 5 deletions frontend/providers/template/src/constants/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ export const theme = extendTheme(sealosTheme, {
}
},
breakpoints: {
sm: '1024px',
md: '1280px',
lg: '1500px',
xl: '1800px',
'2xl': '2100px'
base: '0px',
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px'
},
fontSizes: {
xs: '10px',
Expand Down
4 changes: 2 additions & 2 deletions frontend/providers/template/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ export default function AppList({ showCarousel }: { showCarousel: boolean }) {
<Grid
justifyContent={'center'}
w={'100%'}
gridTemplateColumns="repeat(auto-fill,minmax(344px,1fr))"
gridTemplateColumns="repeat(auto-fill,minmax(320px,1fr))"
gridGap={'24px'}
minW={'960px'}
minW={'480px'}
>
{filterData?.map((item: TemplateType) => {
return (
Expand Down

0 comments on commit ac3aeef

Please sign in to comment.