feat: 迁移类样式到 Tailwind CSS

perf/export-docx
Jimmy Liow 1 year ago
parent 1b1db0937d
commit 8b44f5ce5c

@ -1,23 +1,3 @@
@import 'tailwindcss/base'; @import 'tailwindcss/base';
@import 'tailwindcss/components'; @import 'tailwindcss/components';
@import 'tailwindcss/utilities'; @import 'tailwindcss/utilities';
.logo {
float: left;
height: 36px;
margin: 16px 24px 16px 0;
background: rgba(255, 255, 255, 0.3);
}
.reservation-highlight {
color: rgba(255, 255, 255, 1);
background-color: rgba(255, 0, 0, 0.6);
}
#error-page {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
}

@ -14,7 +14,7 @@ import ErrorBoundary from '@/components/ErrorBoundary'
import { BUILD_VERSION, } from '@/config'; import { BUILD_VERSION, } from '@/config';
import useNoticeStore from '@/stores/Notice'; import useNoticeStore from '@/stores/Notice';
import useAuthStore from '@/stores/Auth' import useAuthStore from '@/stores/Auth'
import { fetchUserDetail} from '@/stores/Auth' import { useThemeContext } from '@/stores/ThemeContext'
import { usingStorage } from '@/hooks/usingStorage' import { usingStorage } from '@/hooks/usingStorage'
import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET } from '@/config' import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET } from '@/config'
@ -24,7 +24,9 @@ const { Title } = Typography;
function App() { function App() {
const { t, i18n } = useTranslation(); const { t, i18n } = useTranslation()
const { colorPrimary } = useThemeContext()
const [password, setPassword] = useState('') const [password, setPassword] = useState('')
@ -76,7 +78,7 @@ function App() {
<ConfigProvider locale={antdLng} <ConfigProvider locale={antdLng}
theme={{ theme={{
token: { token: {
colorPrimary: '#00b96b', colorPrimary: colorPrimary,
}, },
algorithm: theme.defaultAlgorithm, algorithm: theme.defaultAlgorithm,
}}> }}>
@ -105,11 +107,11 @@ function App() {
style={{ style={{
minHeight: '100vh', minHeight: '100vh',
}}> }}>
<Header className='header' style={{ position: 'sticky', top: 0, zIndex: 1, width: '100%' }}> <Header className='sticky top-0 z-10 w-full'>
<Row gutter={{ md: 24 }} justify='end' align='middle'> <Row gutter={{ md: 24 }} justify='end' align='middle'>
<Col span={16}> <Col span={16}>
<NavLink to='/'> <NavLink to='/'>
<img src={AppLogo} className='logo' alt='App logo' /> <img src={AppLogo} className='float-left h-9 my-4 mr-6 ml-0 bg-white/30' alt='App logo' />
</NavLink> </NavLink>
<Menu <Menu
theme='dark' theme='dark'

@ -2,6 +2,7 @@ import { Outlet } from 'react-router-dom'
import { Layout, ConfigProvider, theme, Typography, Row, Col, App as AntApp } from 'antd' import { Layout, ConfigProvider, theme, Typography, Row, Col, App as AntApp } from 'antd'
import 'antd/dist/reset.css' import 'antd/dist/reset.css'
import AppLogo from '@/assets/logo-gh.png' import AppLogo from '@/assets/logo-gh.png'
import { useThemeContext } from '@/stores/ThemeContext'
import Language from '../i18n/LanguageSwitcher' import Language from '../i18n/LanguageSwitcher'
const { Title } = Typography const { Title } = Typography
@ -9,6 +10,8 @@ const { Header, Content, Footer } = Layout
function Standlone() { function Standlone() {
const { colorPrimary } = useThemeContext()
const { const {
token: { colorBgContainer }, token: { colorBgContainer },
} = theme.useToken() } = theme.useToken()
@ -17,7 +20,7 @@ function Standlone() {
<ConfigProvider <ConfigProvider
theme={{ theme={{
token: { token: {
colorPrimary: '#00b96b', colorPrimary: colorPrimary,
}, },
algorithm: theme.defaultAlgorithm, algorithm: theme.defaultAlgorithm,
}}> }}>
@ -26,10 +29,10 @@ function Standlone() {
style={{ style={{
minHeight: '100vh', minHeight: '100vh',
}}> }}>
<Header className='header' style={{ position: 'sticky', top: 0, zIndex: 1, width: '100%' }}> <Header className='sticky top-0 z-10 w-full'>
<Row gutter={{ md: 24 }} justify='center'> <Row gutter={{ md: 24 }} justify='center'>
<Col span={4}> <Col span={4}>
<img src={AppLogo} className='logo' alt='App logo' /> <img src={AppLogo} className='float-left h-9 my-4 mr-6 ml-0 bg-white/30' alt='App logo' />
</Col> </Col>
<Col span={18}><Title style={{ color: 'white', marginTop: '3.5px' }}>Global Highlights Hub</Title></Col> <Col span={18}><Title style={{ color: 'white', marginTop: '3.5px' }}>Global Highlights Hub</Title></Col>
<Col span={2}> <Col span={2}>

@ -21,7 +21,7 @@ function Newest() {
const lastDayjs = dayjs().subtract(1, 'day'); const lastDayjs = dayjs().subtract(1, 'day');
const arrivalDatejs = dayjs(record.arrivalDate); const arrivalDatejs = dayjs(record.arrivalDate);
const requiredHighlight = (arrivalDatejs.isAfter(lastDayjs) && arrivalDatejs.isBefore(after3Dayjs, 'day')) && isEmpty(record.guide); const requiredHighlight = (arrivalDatejs.isAfter(lastDayjs) && arrivalDatejs.isBefore(after3Dayjs, 'day')) && isEmpty(record.guide);
const linkClassName = requiredHighlight ? 'reservation-highlight' : ''; const linkClassName = requiredHighlight ? 'text-white bg-red-500' : '';
return ( return (
<NavLink className={linkClassName} to={`/reservation/${record.reservationId}`}>{text}</NavLink> <NavLink className={linkClassName} to={`/reservation/${record.reservationId}`}>{text}</NavLink>
) )

Loading…
Cancel
Save