🎨 Update theme (#666)
This commit is contained in:
@@ -174,13 +174,7 @@ const AddUser: React.FC<AddUserProps> = ({ isOpen, onClose }) => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
<ModalFooter gap={3}>
|
<ModalFooter gap={3}>
|
||||||
<Button
|
<Button variant="primary" type="submit" isLoading={isSubmitting}>
|
||||||
bg="ui.main"
|
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
type="submit"
|
|
||||||
isLoading={isSubmitting}
|
|
||||||
>
|
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={onClose}>Cancel</Button>
|
<Button onClick={onClose}>Cancel</Button>
|
||||||
|
@@ -163,9 +163,7 @@ const EditUser: React.FC<EditUserProps> = ({ user, isOpen, onClose }) => {
|
|||||||
|
|
||||||
<ModalFooter gap={3}>
|
<ModalFooter gap={3}>
|
||||||
<Button
|
<Button
|
||||||
bg="ui.main"
|
variant="primary"
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
type="submit"
|
type="submit"
|
||||||
isLoading={isSubmitting}
|
isLoading={isSubmitting}
|
||||||
isDisabled={!isDirty}
|
isDisabled={!isDirty}
|
||||||
|
@@ -89,13 +89,7 @@ const Delete: React.FC<DeleteProps> = ({ type, id, isOpen, onClose }) => {
|
|||||||
</AlertDialogBody>
|
</AlertDialogBody>
|
||||||
|
|
||||||
<AlertDialogFooter gap={3}>
|
<AlertDialogFooter gap={3}>
|
||||||
<Button
|
<Button variant="danger" type="submit" isLoading={isSubmitting}>
|
||||||
bg="ui.danger"
|
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
type="submit"
|
|
||||||
isLoading={isSubmitting}
|
|
||||||
>
|
|
||||||
Delete
|
Delete
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
@@ -24,9 +24,7 @@ const Navbar: React.FC<NavbarProps> = ({ type }) => {
|
|||||||
<Input type='text' placeholder='Search' fontSize={{ base: 'sm', md: 'inherit' }} borderRadius='8px' />
|
<Input type='text' placeholder='Search' fontSize={{ base: 'sm', md: 'inherit' }} borderRadius='8px' />
|
||||||
</InputGroup> */}
|
</InputGroup> */}
|
||||||
<Button
|
<Button
|
||||||
bg="ui.main"
|
variant="primary"
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
gap={1}
|
gap={1}
|
||||||
fontSize={{ base: 'sm', md: 'inherit' }}
|
fontSize={{ base: 'sm', md: 'inherit' }}
|
||||||
onClick={type === 'User' ? addUserModal.onOpen : addItemModal.onOpen}
|
onClick={type === 'User' ? addUserModal.onOpen : addItemModal.onOpen}
|
||||||
|
@@ -23,9 +23,9 @@ import SidebarItems from './SidebarItems'
|
|||||||
|
|
||||||
const Sidebar: React.FC = () => {
|
const Sidebar: React.FC = () => {
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const bgColor = useColorModeValue('white', '#1a202c')
|
const bgColor = useColorModeValue('ui.white', 'ui.dark')
|
||||||
const textColor = useColorModeValue('gray', 'white')
|
const textColor = useColorModeValue('ui.light', 'ui.white')
|
||||||
const secBgColor = useColorModeValue('ui.secondary', '#252d3d')
|
const secBgColor = useColorModeValue('ui.secondary', 'ui.darkSlate')
|
||||||
const currentUser = queryClient.getQueryData<UserOut>('currentUser')
|
const currentUser = queryClient.getQueryData<UserOut>('currentUser')
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure()
|
const { isOpen, onOpen, onClose } = useDisclosure()
|
||||||
const { logout } = useAuth()
|
const { logout } = useAuth()
|
||||||
|
@@ -18,7 +18,7 @@ interface SidebarItemsProps {
|
|||||||
|
|
||||||
const SidebarItems: React.FC<SidebarItemsProps> = ({ onClose }) => {
|
const SidebarItems: React.FC<SidebarItemsProps> = ({ onClose }) => {
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const textColor = useColorModeValue('ui.main', '#E2E8F0')
|
const textColor = useColorModeValue('ui.main', 'ui.light')
|
||||||
const bgActive = useColorModeValue('#E2E8F0', '#4A5568')
|
const bgActive = useColorModeValue('#E2E8F0', '#4A5568')
|
||||||
const currentUser = queryClient.getQueryData<UserOut>('currentUser')
|
const currentUser = queryClient.getQueryData<UserOut>('currentUser')
|
||||||
|
|
||||||
|
@@ -103,13 +103,7 @@ const AddItem: React.FC<AddItemProps> = ({ isOpen, onClose }) => {
|
|||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|
||||||
<ModalFooter gap={3}>
|
<ModalFooter gap={3}>
|
||||||
<Button
|
<Button variant="primary" type="submit" isLoading={isSubmitting}>
|
||||||
bg="ui.main"
|
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
type="submit"
|
|
||||||
isLoading={isSubmitting}
|
|
||||||
>
|
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={onClose}>Cancel</Button>
|
<Button onClick={onClose}>Cancel</Button>
|
||||||
|
@@ -104,9 +104,7 @@ const EditItem: React.FC<EditItemProps> = ({ item, isOpen, onClose }) => {
|
|||||||
</ModalBody>
|
</ModalBody>
|
||||||
<ModalFooter gap={3}>
|
<ModalFooter gap={3}>
|
||||||
<Button
|
<Button
|
||||||
bg="ui.main"
|
variant="primary"
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
type="submit"
|
type="submit"
|
||||||
isLoading={isSubmitting}
|
isLoading={isSubmitting}
|
||||||
isDisabled={!isDirty}
|
isDisabled={!isDirty}
|
||||||
|
@@ -21,7 +21,7 @@ interface UpdatePasswordForm extends UpdatePassword {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ChangePassword: React.FC = () => {
|
const ChangePassword: React.FC = () => {
|
||||||
const color = useColorModeValue('gray.700', 'white')
|
const color = useColorModeValue('inherit', 'ui.white')
|
||||||
const showToast = useCustomToast()
|
const showToast = useCustomToast()
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
@@ -114,9 +114,7 @@ const ChangePassword: React.FC = () => {
|
|||||||
)}
|
)}
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<Button
|
<Button
|
||||||
bg="ui.main"
|
variant="primary"
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
mt={4}
|
mt={4}
|
||||||
type="submit"
|
type="submit"
|
||||||
isLoading={isSubmitting}
|
isLoading={isSubmitting}
|
||||||
|
@@ -79,13 +79,7 @@ const DeleteConfirmation: React.FC<DeleteProps> = ({ isOpen, onClose }) => {
|
|||||||
</AlertDialogBody>
|
</AlertDialogBody>
|
||||||
|
|
||||||
<AlertDialogFooter gap={3}>
|
<AlertDialogFooter gap={3}>
|
||||||
<Button
|
<Button variant="danger" type="submit" isLoading={isSubmitting}>
|
||||||
bg="ui.danger"
|
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
type="submit"
|
|
||||||
isLoading={isSubmitting}
|
|
||||||
>
|
|
||||||
Confirm
|
Confirm
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
@@ -21,7 +21,7 @@ import useCustomToast from '../../hooks/useCustomToast'
|
|||||||
|
|
||||||
const UserInformation: React.FC = () => {
|
const UserInformation: React.FC = () => {
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const color = useColorModeValue('gray.700', 'white')
|
const color = useColorModeValue('inherit', 'ui.white')
|
||||||
const showToast = useCustomToast()
|
const showToast = useCustomToast()
|
||||||
const [editMode, setEditMode] = useState(false)
|
const [editMode, setEditMode] = useState(false)
|
||||||
const { user: currentUser } = useAuth()
|
const { user: currentUser } = useAuth()
|
||||||
@@ -109,7 +109,7 @@ const UserInformation: React.FC = () => {
|
|||||||
message: 'Invalid email address',
|
message: 'Invalid email address',
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
type="text"
|
type="email"
|
||||||
size="md"
|
size="md"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@@ -123,9 +123,7 @@ const UserInformation: React.FC = () => {
|
|||||||
</FormControl>
|
</FormControl>
|
||||||
<Flex mt={4} gap={3}>
|
<Flex mt={4} gap={3}>
|
||||||
<Button
|
<Button
|
||||||
bg="ui.main"
|
variant="primary"
|
||||||
color="white"
|
|
||||||
_hover={{ opacity: 0.8 }}
|
|
||||||
onClick={toggleEditMode}
|
onClick={toggleEditMode}
|
||||||
type={editMode ? 'button' : 'submit'}
|
type={editMode ? 'button' : 'submit'}
|
||||||
isLoading={editMode ? isSubmitting : false}
|
isLoading={editMode ? isSubmitting : false}
|
||||||
|
@@ -73,7 +73,7 @@ function Admin() {
|
|||||||
<Tbody>
|
<Tbody>
|
||||||
{users.data.map((user) => (
|
{users.data.map((user) => (
|
||||||
<Tr key={user.id}>
|
<Tr key={user.id}>
|
||||||
<Td color={!user.full_name ? 'gray.600' : 'inherit'}>
|
<Td color={!user.full_name ? 'gray.400' : 'inherit'}>
|
||||||
{user.full_name || 'N/A'}
|
{user.full_name || 'N/A'}
|
||||||
{currentUser?.id === user.id && (
|
{currentUser?.id === user.id && (
|
||||||
<Badge ml="1" colorScheme="teal">
|
<Badge ml="1" colorScheme="teal">
|
||||||
|
@@ -70,7 +70,7 @@ function Items() {
|
|||||||
<Tr key={item.id}>
|
<Tr key={item.id}>
|
||||||
<Td>{item.id}</Td>
|
<Td>{item.id}</Td>
|
||||||
<Td>{item.title}</Td>
|
<Td>{item.title}</Td>
|
||||||
<Td color={!item.description ? 'gray.600' : 'inherit'}>
|
<Td color={!item.description ? 'gray.400' : 'inherit'}>
|
||||||
{item.description || 'N/A'}
|
{item.description || 'N/A'}
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
|
@@ -93,7 +93,7 @@ function Login() {
|
|||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
placeholder="Email"
|
placeholder="Email"
|
||||||
type="text"
|
type="email"
|
||||||
/>
|
/>
|
||||||
{errors.username && (
|
{errors.username && (
|
||||||
<FormErrorMessage>{errors.username.message}</FormErrorMessage>
|
<FormErrorMessage>{errors.username.message}</FormErrorMessage>
|
||||||
|
@@ -1,5 +1,11 @@
|
|||||||
import { extendTheme } from '@chakra-ui/react'
|
import { extendTheme } from '@chakra-ui/react'
|
||||||
|
|
||||||
|
const disabledStyles = {
|
||||||
|
_disabled: {
|
||||||
|
backgroundColor: 'ui.main',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
const theme = extendTheme({
|
const theme = extendTheme({
|
||||||
colors: {
|
colors: {
|
||||||
ui: {
|
ui: {
|
||||||
@@ -7,9 +13,37 @@ const theme = extendTheme({
|
|||||||
secondary: '#EDF2F7',
|
secondary: '#EDF2F7',
|
||||||
success: '#48BB78',
|
success: '#48BB78',
|
||||||
danger: '#E53E3E',
|
danger: '#E53E3E',
|
||||||
|
light: '#E2E8F0',
|
||||||
|
dark: '#1A202C',
|
||||||
|
white: '#FFFFFF',
|
||||||
|
darkSlate: '#252D3D',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
Button: {
|
||||||
|
variants: {
|
||||||
|
primary: {
|
||||||
|
backgroundColor: 'ui.main',
|
||||||
|
color: 'ui.white',
|
||||||
|
_hover: {
|
||||||
|
backgroundColor: '#00766C',
|
||||||
|
},
|
||||||
|
_disabled: {
|
||||||
|
...disabledStyles,
|
||||||
|
_hover: {
|
||||||
|
...disabledStyles,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
danger: {
|
||||||
|
backgroundColor: 'ui.danger',
|
||||||
|
color: 'ui.white',
|
||||||
|
_hover: {
|
||||||
|
backgroundColor: '#E32727',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
Tabs: {
|
Tabs: {
|
||||||
variants: {
|
variants: {
|
||||||
enclosed: {
|
enclosed: {
|
||||||
|
Reference in New Issue
Block a user