Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Marques authored and Hugo Marques committed Nov 24, 2023
1 parent f21bd74 commit 4f14b96
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 98 deletions.
98 changes: 55 additions & 43 deletions src/components/Stories/StoryInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,59 +27,71 @@ const GridStyled = styled.div`
}
}
${mq.phone(css`
grid-template-areas: 'love comment report' 'numbers numbers numbers';
grid-template-columns: repeat(3, auto);
.numbers {
flex-direction: row;
justify-content: center;
.dot {
display: block;
${mq.from(
'xs',
css`
grid-template-areas: 'love comment report' 'numbers numbers numbers';
grid-template-columns: repeat(3, auto);
.numbers {
flex-direction: row;
justify-content: center;
.dot {
display: block;
}
}
}
`)}
`
)}
${mq.tablet(css`
grid-template-areas: 'love comment' 'numbers report';
grid-template-columns: repeat(2, auto);
${mq.from(
'sm',
css`
grid-template-areas: 'love comment' 'numbers report';
grid-template-columns: repeat(2, auto);
.numbers {
flex-direction: column;
.numbers {
flex-direction: column;
.dot {
display: none;
.dot {
display: none;
}
}
}
`)}
${mq.tabletLandscape(css`
grid-template-areas: 'love comment report' 'numbers numbers numbers';
grid-template-columns: repeat(3, auto);
.numbers {
flex-direction: row;
justify-content: center;
.dot {
display: block;
`
)}
${mq.from(
'md',
css`
grid-template-areas: 'love comment report' 'numbers numbers numbers';
grid-template-columns: repeat(3, auto);
.numbers {
flex-direction: row;
justify-content: center;
.dot {
display: block;
}
}
}
`)}
`
)}
${mq.desktop(css`
grid-template-areas: 'love comment numbers report';
grid-template-columns: repeat(4, auto);
${mq.from(
'lg',
css`
grid-template-areas: 'love comment numbers report';
grid-template-columns: repeat(4, auto);
.numbers {
flex-direction: column;
.numbers {
flex-direction: column;
.dot {
display: none;
.dot {
display: none;
}
}
}
`)}
`
)}
`;

const StoryInfo = (props: any) => {
Expand Down
15 changes: 10 additions & 5 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import {
} from '@impact-market/ui';
import { PrismicDataProvider } from '../libs/Prismic/components/PrismicDataProvider';
import { Provider, useSelector } from 'react-redux';
import { ThemeProvider } from 'styled-components';
import { WagmiConfig, useAccount } from 'wagmi';
import { getCookie, hasCookie } from 'cookies-next';
import { handleFirebaseServiceWorker } from 'src/hooks/firebase/handleFirebaseServiceWorker';
import { handleFirebaseServiceWorker } from '../hooks/firebase/handleFirebaseServiceWorker';
import { isSupported } from 'firebase/messaging';
import { registerFirebaseSW } from 'src/hooks/useServiceWorker';
import { registerFirebaseSW } from '../hooks/useServiceWorker';
import { theme } from '../theme/theme';

import {
selectCurrentUser,
setSignature,
Expand Down Expand Up @@ -156,9 +159,11 @@ const App = (props: AppProps) => {
<WrapperProvider>
<Provider store={store}>
<ApolloProvider client={apolloClient}>
<ModalManager modals={modals} />
<Toaster />
<InnerApp {...props} />
<ThemeProvider theme={theme}>
<ModalManager modals={modals} />
<Toaster />
<InnerApp {...props} />
</ThemeProvider>
<GoogleAnalytics />
</ApolloProvider>
</Provider>
Expand Down
8 changes: 8 additions & 0 deletions src/theme/helpers/mq.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { mq as baseMq } from 'styled-gen';
import { theme } from '../theme';

export const mq = Object.keys(theme).reduce(
// @ts-ignore
(result, bp) => ({ ...result, [bp]: (style: any) => baseMq.bp(bp, style) }),
{}
) as { [bp in keyof typeof theme]: Function };
10 changes: 10 additions & 0 deletions src/theme/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const breakpoints = {
lg: 76,
md: 64,
sm: 48,
xs: 0
};

export const theme = {
breakpoints
};
33 changes: 20 additions & 13 deletions src/views/MicroCredit/Application/FormSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,35 @@ import { Box, Card, Col, Row } from '@impact-market/ui';
import { mq } from 'styled-gen';
import FullWidthField from './FullWidthField';
import MobileBankerSelector from './MobileBankerSelector';
import React from 'react';
import RichText from '../../../libs/Prismic/components/RichText';
import styled, { css } from 'styled-components';

const Section = styled(Row)`
${mq.phone(css`
margin-bottom: 3rem;
${mq.from(
'xs',
css`
margin-bottom: 3rem;
.section-info {
margin-bottom: 1rem;
}
`)};
.section-info {
margin-bottom: 1rem;
}
`
)};
`;

const DoubleInputWrapper = styled(Row)`
${mq.phone(css`
flex-direction: column;
${mq.from(
'xs',
css`
flex-direction: column;
> .column {
flex-basis: 100% !important;
width: 100%;
}
`)};
> .column {
flex-basis: 100% !important;
width: 100%;
}
`
)};
`;

export interface FormSectionProps {
Expand Down
30 changes: 18 additions & 12 deletions src/views/MicroCredit/Application/FullWidthField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getCookie } from 'cookies-next';
import { mq } from 'styled-gen';
import { selectCurrentUser } from '../../../state/slices/auth';
import { useEffect, useState } from 'react';
import { useGetMicrocreditPreSignedMutation } from 'src/api/microcredit';
import { useGetMicrocreditPreSignedMutation } from '../../../api/microcredit';
import { useSelector } from 'react-redux';

import RichText from '../../../libs/Prismic/components/RichText';
Expand Down Expand Up @@ -67,9 +67,12 @@ const CheckBox = styled(Box)`
`;

const Spacer = styled(Box)`
${mq.phone(css`
display: none;
`)};
${mq.from(
'xs',
css`
display: none;
`
)};
`;

const CurrencySelector = styled(DropdownMenu)`
Expand Down Expand Up @@ -101,14 +104,17 @@ const CurrencyWrapper = styled(Box)`
flex-basis: 49%;
}
${mq.phone(css`
flex-wrap: wrap;
.column {
min-width: 10rem;
flex-basis: 100%;
}
`)};
${mq.from(
'xs',
css`
flex-wrap: wrap;
.column {
min-width: 10rem;
flex-basis: 100%;
}
`
)};
`;

export interface FullWidthProps {
Expand Down
16 changes: 10 additions & 6 deletions src/views/MicroCredit/Application/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { Box, Button, Card, Col, Input, Row, colors } from '@impact-market/ui';
import { mq } from 'styled-gen';
import React from 'react';
import RichText from '../../../libs/Prismic/components/RichText';
import styled, { css } from 'styled-components';
import useTranslations from '../../../libs/Prismic/hooks/useTranslations';

const Section = styled(Row)`
${mq.phone(css`
margin-bottom: 3rem;
${mq.from(
'xs',
css`
margin-bottom: 3rem;
.section-info {
margin-bottom: 1rem;
}
`)};
.section-info {
margin-bottom: 1rem;
}
`
)};
`;

const SelectElement = styled(Button)`
Expand Down
44 changes: 25 additions & 19 deletions src/views/MicroCredit/LoanRepayment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,36 @@ const BorderWrapper = styled(Box)`
`;

const ActionWrapper = styled(Box)`
${mq.phone(css`
flex-direction: column;
${mq.from(
'xs',
css`
flex-direction: column;
> .approve,
.repay {
width: 100%;
}
> .approve,
.repay {
width: 100%;
}
> svg {
transform: rotate(90deg);
}
`)}
> svg {
transform: rotate(90deg);
}
`
)}
${mq.tabletLandscape(css`
flex-direction: row;
${mq.from(
'md',
css`
flex-direction: row;
> .approve {
flex: 1;
}
> .approve {
flex: 1;
}
> svg {
transform: rotate(0deg);
}
`)}
> svg {
transform: rotate(0deg);
}
`
)}
`;

const LoanRepayment = (props: any) => {
Expand Down

0 comments on commit 4f14b96

Please sign in to comment.