Skip to content

Commit

Permalink
Fixed icon bug and finalzied styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaosaur committed May 29, 2023
1 parent 99589d1 commit 53d470a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 40 deletions.
78 changes: 42 additions & 36 deletions src/components/ListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,43 +51,49 @@ export function ListItem({ item, listId, handleDeleteConfirmation, urgency }) {
name={name}
/>
<AccordionItem key={item.id} borderTop="0px" borderBottom="0px">
<h2>
<AccordionButton
_expanded={{ bg: '#DEDFE3', color: '#3B293D' }}
_hover={{ bg: '#DEDFE3', color: '#3B293D' }}
>
<Box as="span" flex="1" textAlign="left">
<li className="ListItem" style={{ display: 'block' }}>
<Checkbox
size="lg"
onChange={handlePurchase}
isChecked={isWithinLastDay(item.dateLastPurchased)}
colorScheme={urgencyColors[urgency]}
bg={urgencyColors[urgency]}
borderRadius="md"
margin="1"
></Checkbox>
<label htmlFor={`mark-${name}-purchased-id-${id}`}>
{name}
</label>
</li>
</Box>
<AccordionButton
color="text.500"
_expanded={{
bg: 'text.500',
color: 'brand.500',
}}
_hover={{
bg: 'text.500',
color: 'brand.500',
}}
>
<Box as="span" flex="1" textAlign="left">
<li className="ListItem" style={{ display: 'block' }}>
<Checkbox
size="lg"
onChange={handlePurchase}
isChecked={isWithinLastDay(item.dateLastPurchased)}
colorScheme={urgencyColors[urgency]}
bg={urgencyColors[urgency]}
borderRadius="md"
margin="1"
></Checkbox>
<label htmlFor={`mark-${name}-purchased-id-${id}`}>{name}</label>
</li>
</Box>

<IconButton
aria-label="delete"
size="sm"
bg="none"
m="0.5em"
onClick={(e) => {
e.stopPropagation();
onOpen();
}}
icon={<DeleteIcon />}
/>

<AccordionIcon />
</AccordionButton>
</h2>
<IconButton
aria-label="delete"
size="sm"
m="0.5em"
isActive
bg="transparent"
colorScheme="transparent"
color="currentColor"
transition="none"
onClick={(e) => {
e.stopPropagation();
onOpen();
}}
icon={<DeleteIcon />}
/>
<AccordionIcon />
</AccordionButton>
<AccordionPanel pd={4}>
<Center>
<ListItemDetails
Expand Down
3 changes: 1 addition & 2 deletions src/views/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Outlet, useLocation } from 'react-router-dom';
import { useDisclosure } from '@chakra-ui/hooks';
import { About } from '../components/About';


export function Layout() {
const { isOpen, onOpen, onClose } = useDisclosure();
const location = useLocation();
Expand All @@ -27,7 +26,7 @@ export function Layout() {
<VisuallyHidden>Open about modal</VisuallyHidden>
</Heading>
</Center>
<Box as="main" h="100%">
<Box as="main" h="100%" p={8}>
<Outlet />
</Box>
</Flex>
Expand Down
4 changes: 2 additions & 2 deletions src/views/List.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function List({ data, listId }) {
{listId}

<IconButton
aria-label="delete"
aria-label="copy"
size="sm"
bg="none"
_hover={{ cursor: 'pointer' }}
Expand All @@ -88,7 +88,7 @@ export function List({ data, listId }) {
navigator.clipboard.writeText(`${listId}`);
successToast({ description: `Token copied!` });
}}
icon={<CopyIcon />}
icon={<CopyIcon color="text.500" />}
/>
</Text>
<IconButton
Expand Down

0 comments on commit 53d470a

Please sign in to comment.