Skip to content

Commit

Permalink
doc: update
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-eof committed Apr 29, 2023
1 parent 36f7f3f commit d4ee8b0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 25 deletions.
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ import {
useColorModeValue,
Stack,
useStatStyles,
Icon,
} from '@chakra-ui/react';
import {
HamburgerIcon,
CloseIcon,
AddIcon,
ViewOffIcon,
TriangleDownIcon,
} from '@chakra-ui/icons';
import { Route, Routes, useNavigate } from 'react-router-dom';
import Home from './components/Home';
Expand Down Expand Up @@ -122,9 +124,13 @@ export default function Main() {
<Avatar
size={'sm'}
src={
'https://images.unsplash.com/photo-1493666438817-866a91353ca9?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&fit=crop&h=200&w=200&s=b616b2c5b373a80ffc9636ba24f7a4a9'
'https://i.pinimg.com/280x280_RS/af/db/37/afdb379ece8167459322717886a51af9.jpg'
}
/>
<Box fontSize={'0.7em'}>
{localStorage.getItem('username')}
<Icon ml={1} as={TriangleDownIcon} />
</Box>
</MenuButton>
<MenuList>
<MenuItem
Expand Down
50 changes: 29 additions & 21 deletions src/components/JobOffersRequests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,44 +104,52 @@ function JobComponent({ job }: JobProps) {
/>
</Skeleton>

<SimpleGrid columns={2} spacingX={100}>
<Stack spacing={0}>
<SimpleGrid columns={{ base: 1, md: 2 }} w={'full'}>
<Stack spacing={4} w={'full'}>
<CardBody>
<Heading size="md">{job.title} </Heading>
<Heading
cursor={'pointer'}
color={'blue.400'}
_hover={{ color: 'blue.500' }}
size="md"
onClick={() => goToViewOfferRequest(job.id)}
>
{job.title}{' '}
</Heading>
<Box fontSize={'0.8em'}>
by {job.author?.firstname} {job.author?.lastname}
{' | '} <Stars num={job.author?.stars} />
</Box>
<Text py="2">{job.description}</Text>
</CardBody>
<CardFooter justify={'center'}>
<Button variant="solid" colorScheme="blue">
{calulateAcceptButtonLabel()}
</Button>
<Button
mx={3}
variant={'solid'}
colorScheme="green"
onClick={() => goToViewOfferRequest(job.id)}
>
View
</Button>
</CardFooter>
<CardFooter justify={'center'}></CardFooter>
</Stack>
<Stack p={5} align={'end'} float={'right'}>
<Flex w={'full'}>
<Box
borderRadius={'10px'}
verticalAlign={'top'}
maxW={'200px'}
boxShadow={'md'}
w={'full'}
textAlign={'right'}
p={10}
>
<Flex textAlign={'left'}>Price:</Flex>
<Box textAlign={'right'}>Price:</Box>
<Box fontSize={'1.3em'} fontWeight={'bold'}>
{job.price}
</Box>
<Box mt={4}>
<Button mr={3} variant="solid" colorScheme="blue">
{calulateAcceptButtonLabel()}
</Button>
<Button
variant={'solid'}
colorScheme="green"
onClick={() => goToViewOfferRequest(job.id)}
>
View
</Button>
</Box>
</Box>
</Stack>
</Flex>
</SimpleGrid>
</Card>
);
Expand Down
6 changes: 4 additions & 2 deletions src/interceptors/LoginInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export const customInterceptor = (navigate: any) => {
);
// return Promise.resolve(data);
} else {
localStorage.clear();
localStorage.removeItem('access_token');
localStorage.removeItem('refresh_token');
navigate('/authenticate');
return Promise.reject(error);
}
Expand All @@ -48,7 +49,8 @@ export const customInterceptor = (navigate: any) => {

const refreshToken = (error: any, navigate: (path: string) => {}) => {
let tokensData = localStorage.getItem('refresh_token');
localStorage.clear();
localStorage.removeItem('access_token');
localStorage.removeItem('refresh_token');
if (tokensData) {
return GenericService.postHeaders('api/v1/auth/refreshToken', {
headers: {
Expand Down
3 changes: 2 additions & 1 deletion src/service/AuthenticationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default class AuthenticationService {
Authorization: `Bearer ${tokensData}`,
},
}).then(() => {
localStorage.clear();
localStorage.removeItem('access_token');
localStorage.removeItem('refresh_token');

console.log('logout done');
callback();
Expand Down

0 comments on commit d4ee8b0

Please sign in to comment.