Skip to content

Commit

Permalink
Merge branch 'dev' into feat/105-review-modal-text
Browse files Browse the repository at this point in the history
  • Loading branch information
heronlancellot committed Oct 20, 2023
2 parents 7fe1f0b + e48196a commit 308b0c5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
5 changes: 2 additions & 3 deletions src/components/Cover/CoverHomeTasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
const CoverHomeTasks = () => {
const theme = useTheme();
const mdDown = useMediaQuery(theme.breakpoints.down('md'));
const xsDown = useMediaQuery(theme.breakpoints.down('xs'));
const smDown = useMediaQuery(theme.breakpoints.down('sm'));
return (
<Box display={'flex'} justifyContent={'center'} alignItems={'center'} height={304} >
Expand All @@ -23,15 +22,15 @@ const CoverHomeTasks = () => {

<Box >
<Box>
<Typography color={theme.colors.primary} fontWeight={"bold"} fontSize={mdDown ? 35 : xsDown ? 20 : 50}>
<Typography color={theme.colors.primary} fontWeight={"bold"} fontSize={smDown ? 20 : mdDown ? 30 : 50}>
WEB3TASK
</Typography>
</Box>
<Box>
<img
src="/static/images/task/home/detail.svg"
alt="4 Pontos Interligados"
width={75}
width={mdDown ? 55 : 75}
/>
</Box>
</Box>
Expand Down
13 changes: 7 additions & 6 deletions src/components/Cover/CoverUserProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { Box, Typography } from '@mui/material'
import { Box, Typography, useMediaQuery } from '@mui/material'
import {
useTheme,
} from "@mui/material";

const CoverCreateTask = () => {
const theme = useTheme();
const mdDown = useMediaQuery(theme.breakpoints.down('md'));
const smDown = useMediaQuery(theme.breakpoints.down('xs'));
return (
<Box display={'flex'} justifyContent={'center'} alignItems={'center'} height={304} flexDirection={"row"} >

<Box>

<Box>
<Typography color={theme.colors.primary} fontWeight={"bold"} fontSize={50}>
<Box ml={mdDown && 8}>
<Box style={{ zIndex: 3 }} >
<Typography color={theme.colors.primary} fontWeight={"bold"} fontSize={smDown ? 20 : mdDown ? 30 : 50}>
PERSONAL PROFILE
</Typography>
</Box>
<Box>
<img
src="/static/images/task/home/detail.svg"
alt="4 Pontos Interligados"
width={75}
width={mdDown ? 55 : 75}
/>
</Box>
</Box>
Expand Down
13 changes: 6 additions & 7 deletions src/content/applications/Tasks/HomeTasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ const HomeTasks = () => {
}
};

useEffect(() => {
setMinimumTasks(((currentPage - 1) * tasksPerPage) + 1);
setMaxTasks(currentPage * tasksPerPage);
fetchData();
}, [currentPage, totalPages, minimumTasks, maxTasks]);


const maxReward = multiTasksData?.reduce((acc, curr) => {
const parsedReward = Number.parseFloat(curr.reward)

Expand All @@ -52,6 +45,12 @@ const HomeTasks = () => {

const filteredMultiTasks = filterTasks(multiTasksData || [])

useEffect(() => {
setMinimumTasks(((currentPage - 1) * tasksPerPage) + 1);
setMaxTasks(currentPage * tasksPerPage);
fetchData();
}, [currentPage, totalPages, minimumTasks, maxTasks]);

return (
<>
<Helmet>
Expand Down
27 changes: 14 additions & 13 deletions src/content/applications/Users/profile/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const BoxCoverAction = styled(Box)(
const UserProfile = () => {
const theme = useTheme();
const mdDown = useMediaQuery(theme.breakpoints.down('md'));
const smDown = useMediaQuery(theme.breakpoints.down('sm'));
const { shortenAddressFromUser, userAddress } = useWeb3Utils();
const taskService = useTaskService();
const { handleCountUserTasks, handleUserScore, countUserTasks, handleMultiTask, multiTasksData, loading } = useTaskServiceHook(taskService);
Expand Down Expand Up @@ -79,14 +80,15 @@ const UserProfile = () => {
<Helmet>
<title>Web3Task - Profile</title>
</Helmet>

<Box>
<BoxCover display={'flex'} justifyContent={'center'} alignItems={'center'} height={304} flexDirection={"row"} >
<Box style={{ position: 'relative' }} >
<Box
style={{
position: 'absolute',
top: 'calc(50% + 0px)',
left: 'calc(50% - 315px)',
left: smDown ? 'calc(50% + 50px)' : mdDown ? 'calc(50% + 0px)' : 'calc(50% - 315px)',
transform: 'translate(-50%, -50%)',
zIndex: 2,
pointerEvents: 'none'
Expand All @@ -95,7 +97,7 @@ const UserProfile = () => {
<img
src="/static/images/user/profile/cube.svg"
alt="astronaut"
width={251}
width={smDown ? 181 : 251}
style={{
pointerEvents: 'none'
}}
Expand All @@ -106,7 +108,7 @@ const UserProfile = () => {
style={{
position: 'absolute',
top: 'calc(50% + 180px)',
left: 'calc(50% - 250px)',
left: smDown ? 'calc(50% + 185px)' : mdDown ? 'calc(50% + 210px)' : 'calc(50% - 250px)',
transform: 'translate(-50%, -50%)',
zIndex: 2,
pointerEvents: 'none'
Expand All @@ -115,7 +117,7 @@ const UserProfile = () => {
<img
src="/static/images/user/profile/profile.svg"
alt="astronaut"
width={251}
width={mdDown ? 181 : 251}
style={{
pointerEvents: 'none'
}}
Expand All @@ -130,7 +132,7 @@ const UserProfile = () => {
style={{
position: 'absolute',
top: 'calc(50% + 230px)',
left: 'calc(50% - 250px)',
left: smDown ? 'calc(50% + 150px)' : mdDown ? 'calc(50% + 50px)' : 'calc(50% - 250px)',
transform: 'translate(-50%, -50%)',
zIndex: 1,
pointerEvents: 'none',
Expand All @@ -139,17 +141,16 @@ const UserProfile = () => {

</Box>

<Box>
<Box justifyContent={"center"} alignItems="center">
<CoverUserProfile />
</Box>

<Box style={{ position: 'relative' }} >

<Box
style={{
position: 'absolute',
top: 'calc(50% + 100px)',
left: 'calc(50% + 150px)',
left: smDown? 'calc(50% - 110px)' : mdDown ? 'calc(50% - 50px)' : 'calc(50% + 150px)',
transform: 'translate(-50%, -50%)',
zIndex: 2,
pointerEvents: 'none'
Expand All @@ -174,15 +175,15 @@ const UserProfile = () => {
style={{
position: 'absolute',
top: 'calc(50% + 230px)',
left: 'calc(50% + 300px)',
left: smDown ? 'calc(50% + 80px)' : mdDown ? 'calc(50% + 70px)' : 'calc(50% + 300px)',
transform: 'translate(-50%, -50%)',
zIndex: 1,
pointerEvents: 'none',
}}
/>

</Box>
<BoxCoverAction>
<BoxCoverAction mt={smDown ? 13 : mdDown ? 15 : 0}>
<Typography gutterBottom variant="h5" component="div" textAlign="center">
{shortenAddressFromUser()}
</Typography>
Expand All @@ -192,12 +193,12 @@ const UserProfile = () => {
</BoxCover>
<Box>

<Grid container spacing={5} mt={10} ml={mdDown ? 3 : 15} mr={15} style={{ width: '100%' }} >
<Grid item xs={mdDown ? 4 : 2} mt={5}>
<Grid display={'flex'} spacing={1} mt={mdDown ? 20 : 15} ml={smDown ? -3 : mdDown ? 2 : 15} style={{ width: '92%' }} >
<Grid item xs={smDown ? 4 : 2} ml={smDown && 1.5 } mt={5} display={'flex'}>
<SearchFilters maxReward={maxReward} />
</Grid>

<Grid item xs={mdDown ? 8 : 10} style={{ width: '100%' }}>
<Grid item xs={smDown ? 8 : 10} ml={smDown && -2 } mt={smDown && -2 } style={{ width: '92%' }}>
<CardMultiTasks multiTasksData={filteredMultiTasks} loading={loading} page={currentPage} />
</Grid>
</Grid>
Expand Down
6 changes: 4 additions & 2 deletions src/layouts/BaseLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const BaseLayout: FC<BaseLayoutProps> = () => {
position: 'relative',
zIndex: 5,
display: 'block',
flex: 1
flex: 1,
mb: 1
}}
>
<Box display="block">
Expand All @@ -74,7 +75,8 @@ const BaseLayout: FC<BaseLayoutProps> = () => {
position: 'relative',
zIndex: 5,
display: 'block',
flex: 1
flex: 1,
mb: 0
}}
>
<Box display="block">
Expand Down

0 comments on commit 308b0c5

Please sign in to comment.