Skip to content

Commit

Permalink
Merge pull request #1563 from Giveth/release-2.2.8
Browse files Browse the repository at this point in the history
Release 2.2.8
  • Loading branch information
alireza-sharifpour authored Sep 27, 2022
2 parents ed47e9e + fab59ad commit fa94f0b
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 56 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.2.7",
"version": "2.2.8",
"private": true,
"scripts": {
"build": "next build",
Expand All @@ -19,7 +19,7 @@
"@ethersproject/contracts": "^5.5.0",
"@ethersproject/providers": "^5.5.0",
"@ethersproject/units": "^5.5.0",
"@giveth/ui-design-system": "^1.8.8",
"@giveth/ui-design-system": "^1.8.22",
"@gnosis.pm/safe-apps-web3-react": "^1.5.0",
"@reduxjs/toolkit": "^1.8.1",
"@sentry/nextjs": "^6.19.3",
Expand Down
6 changes: 3 additions & 3 deletions src/components/cards/BaseStakingCard.sc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
P,
Caption,
Button,
OulineButton,
OutlineButton,
Subline,
} from '@giveth/ui-design-system';
import { Flex } from '../styled-components/Flex';
Expand Down Expand Up @@ -76,7 +76,7 @@ export const StakeButtonsRow = styled(Flex)`
gap: 16px;
`;

export const StakeButton = styled(OulineButton)`
export const StakeButton = styled(OutlineButton)`
width: 100%;
`;

Expand Down Expand Up @@ -190,7 +190,7 @@ export const DisableModalText = styled(P)<{ weight?: number }>`
font-weight: ${props => (props.weight ? props.weight : 400)};
`;

export const DisableModalCloseButton = styled(OulineButton)`
export const DisableModalCloseButton = styled(OutlineButton)`
border: none;
color: ${brandColors.giv[500]};
font-weight: 700;
Expand Down
56 changes: 31 additions & 25 deletions src/components/homeTabs/GIVbacks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,33 +122,36 @@ export const TabGIVbacksTop = () => {

export const TabGIVbacksBottom = () => {
const [round, setRound] = useState(0);
const [roundStartime, setRoundStartime] = useState(new Date());
const [roundStarTime, setRoundStarTime] = useState(new Date());
const [roundEndTime, setRoundEndTime] = useState(new Date());
const { givTokenDistroHelper } = useGIVTokenDistroHelper();
const { givTokenDistroHelper, isLoaded } = useGIVTokenDistroHelper();

useEffect(() => {
if (givTokenDistroHelper) {
if (
givTokenDistroHelper &&
isLoaded &&
givTokenDistroHelper.startTime.getTime() !== 0
) {
const now = getNowUnixMS();
const deltaT = now - givTokenDistroHelper.startTime.getTime();
const ROUND_20_OFFSET = 4; // At round 20 we changed the rounds from Fridays to Tuesdays
const startTime = new Date(givTokenDistroHelper.startTime);
startTime.setDate(startTime.getDate() + ROUND_20_OFFSET);
const deltaT = now - startTime.getTime();
const TwoWeek = 1_209_600_000;
const _round = Math.floor(deltaT / TwoWeek) + 1;
setRound(_round);
const _rounStartTime = new Date(givTokenDistroHelper.startTime);
_rounStartTime.setDate(
givTokenDistroHelper.startTime.getDate() + (_round - 1) * 14,
);
_rounStartTime.setHours(givTokenDistroHelper.startTime.getHours());
_rounStartTime.setMinutes(
givTokenDistroHelper.startTime.getMinutes(),
);
setRoundStartime(_rounStartTime);
const _roundEndTime = new Date(_rounStartTime);
_roundEndTime.setDate(_rounStartTime.getDate() + 14);
_roundEndTime.setHours(givTokenDistroHelper.startTime.getHours());
_roundEndTime.setMinutes(
givTokenDistroHelper.startTime.getMinutes(),
);
const _roundEndTime = new Date(startTime);
_roundEndTime.setDate(startTime.getDate() + _round * 14);
_roundEndTime.setHours(startTime.getHours());
_roundEndTime.setMinutes(startTime.getMinutes());
setRoundEndTime(_roundEndTime);
const _roundStartTime = new Date(_roundEndTime);
if (_round === 20) {
_roundStartTime.setDate(_roundEndTime.getDate() - 18);
} else {
_roundStartTime.setDate(_roundEndTime.getDate() - 14);
}
setRoundStarTime(_roundStartTime);
}
}, [givTokenDistroHelper]);

Expand Down Expand Up @@ -197,7 +200,10 @@ export const TabGIVbacksBottom = () => {
<Col xs={12} md={8}>
<RoundSection>
<RoundTitle>
GIVbacks <NoWrap>Round {round}</NoWrap>
GIVbacks{' '}
<NoWrap>
Round {isLoaded ? round : '--'}
</NoWrap>
</RoundTitle>
<RoundInfo>
<RoundInfoTallRow
Expand All @@ -211,9 +217,9 @@ export const TabGIVbacksBottom = () => {
</P>
<P>
<NoWrap>
{givTokenDistroHelper
? formatDate(roundStartime)
: '-'}
{isLoaded
? formatDate(roundStarTime)
: '--'}
</NoWrap>
</P>
</RoundInfoTallRow>
Expand All @@ -227,9 +233,9 @@ export const TabGIVbacksBottom = () => {
</P>
<P>
<NoWrap>
{givTokenDistroHelper
{isLoaded
? formatDate(roundEndTime)
: '-'}
: '--'}
</NoWrap>
</P>
</RoundInfoTallRow>
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/GIVBackExplain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
GLink,
brandColors,
IconExternalLink,
OulineButton,
OutlineButton,
IconGIVBack,
} from '@giveth/ui-design-system';
import styled from 'styled-components';
Expand Down Expand Up @@ -77,7 +77,7 @@ const LinksRow = styled(Flex)`
margin-bottom: 24px;
`;

const GotItButton = styled(OulineButton)`
const GotItButton = styled(OutlineButton)`
width: 316px;
margin: 0 auto;
`;
4 changes: 2 additions & 2 deletions src/components/modals/LowerShields.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image';
import styled from 'styled-components';
import { Lead, Button, OulineButton } from '@giveth/ui-design-system';
import { Lead, Button, OutlineButton } from '@giveth/ui-design-system';

import { Modal } from '@/components/modals/Modal';
import ShieldBlackIcon from '/public/images/icons/shield_black.svg';
Expand Down Expand Up @@ -42,7 +42,7 @@ const LowerShields = (props: { onClose: () => void }) => {
window for you to complete your sign-in
</Lead>
{isDark ? (
<OulineButton label='OK' onClick={closeModal} />
<OutlineButton label='OK' onClick={closeModal} />
) : (
<Button label='OK' onClick={closeModal} />
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/ShareModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
H5,
Lead,
neutralColors,
OulineButton,
OutlineButton,
} from '@giveth/ui-design-system';

import { Modal } from './Modal';
Expand Down Expand Up @@ -111,7 +111,7 @@ const LeadText = styled(Lead)`
color: ${brandColors.deep[900]};
`;

const CustomOutlineButton = styled(OulineButton)`
const CustomOutlineButton = styled(OutlineButton)`
text-transform: uppercase;
font-weight: 700;
border: none;
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/Stake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Button,
H4,
neutralColors,
OulineButton,
OutlineButton,
P,
SublineBold,
} from '@giveth/ui-design-system';
Expand Down Expand Up @@ -510,7 +510,7 @@ const InnerModal = styled.div`
padding: 0 24px;
`;

const ApproveButton = styled(OulineButton)`
const ApproveButton = styled(OutlineButton)`
width: 100%;
margin-top: 32px;
margin-bottom: 8px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/WhatisStream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
GLink,
brandColors,
IconExternalLink,
OulineButton,
OutlineButton,
} from '@giveth/ui-design-system';
import styled from 'styled-components';
import { FC } from 'react';
Expand Down Expand Up @@ -124,7 +124,7 @@ const LinksRow = styled(FlexCenter)`
margin-bottom: 24px;
`;

const GotItButton = styled(OulineButton)`
const GotItButton = styled(OutlineButton)`
width: 316px;
margin: 0 auto;
`;
6 changes: 3 additions & 3 deletions src/components/views/create/CreateProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
H5,
IconExternalLink,
neutralColors,
OulineButton,
OutlineButton,
} from '@giveth/ui-design-system';
import { useMutation } from '@apollo/client';
import { utils } from 'ethers';
Expand Down Expand Up @@ -396,7 +396,7 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
</PublishList>
<Buttons>
{(!isEditMode || isDraft) && (
<OulineButton
<OutlineButton
label='PREVIEW '
buttonType='primary'
disabled={isLoading}
Expand All @@ -414,7 +414,7 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
disabled={isLoading}
/>
{isEditMode && (
<OulineButton
<OutlineButton
onClick={() => router.back()}
label='CANCEL'
buttonType='primary'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
Button,
brandColors,
neutralColors,
OulineButton,
OutlineButton,
} from '@giveth/ui-design-system';
import { motion } from 'framer-motion';
import { captureException } from '@sentry/nextjs';
Expand Down Expand Up @@ -416,7 +416,7 @@ const FullButton = styled(Button)`
}
`;

const FullOutlineButton = styled(OulineButton)`
const FullOutlineButton = styled(OutlineButton)`
width: 100%;
`;

Expand Down
4 changes: 2 additions & 2 deletions src/components/views/projects/ProjectsIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
neutralColors,
Subline,
H3,
OulineButton,
OutlineButton,
Lead,
} from '@giveth/ui-design-system';
import styled from 'styled-components';
Expand Down Expand Up @@ -307,7 +307,7 @@ const Loader = styled.div`
margin: 20px auto;
`;

const StyledButton = styled(OulineButton)<{ transparent?: boolean }>`
const StyledButton = styled(OutlineButton)<{ transparent?: boolean }>`
color: ${brandColors.pinky[500]};
border-color: ${props =>
props.transparent ? 'transparent' : brandColors.pinky[500]};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
H1,
QuoteText,
Button,
OulineButton,
OutlineButton,
} from '@giveth/ui-design-system';

import Routes from '@/lib/constants/Routes';
Expand Down Expand Up @@ -112,7 +112,7 @@ const PublicProfileOverviewTab: FC<IUserPublicProfileView> = ({ user }) => {
onClick: btn.onClick,
};
if (btn.outline)
return <OulineButton key={index} {...props} />;
return <OutlineButton key={index} {...props} />;
return <Button key={index} {...props} />;
})}
</Buttons>
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/verification/Common.sc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import {
Button,
H6,
neutralColors,
OulineButton,
OutlineButton,
semanticColors,
} from '@giveth/ui-design-system';
import { Flex, FlexCenter } from '@/components/styled-components/Flex';
import { Shadow } from '@/components/styled-components/Shadow';
import { mediaQueries } from '@/lib/constants/constants';

export const OutlineStyled = styled(OulineButton)`
export const OutlineStyled = styled(OutlineButton)`
padding-left: 100px;
padding-right: 100px;
margin-bottom: 24px;
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useGIVTokenDistroHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ export const defaultTokenDistroHelper = new TokenDistroHelper({
const useGIVTokenDistroHelper = () => {
const [givTokenDistroHelper, setGIVTokenDistroHelper] =
useState<TokenDistroHelper>(defaultTokenDistroHelper);
const [isLoaded, setIsLoaded] = useState(false);
const currentValue = useAppSelector(
state => state.subgraph.currentValues,
shallowEqual,
);
useEffect(() => {
const sdh = new SubgraphDataHelper(currentValue);
setGIVTokenDistroHelper(new TokenDistroHelper(sdh.getGIVTokenDistro()));
setIsLoaded(currentValue.isLoaded as boolean);
}, [currentValue]);
return { givTokenDistroHelper };
return { givTokenDistroHelper, isLoaded };
};

export default useGIVTokenDistroHelper;
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,10 @@
"@ethersproject/properties" "^5.6.0"
"@ethersproject/strings" "^5.6.1"

"@giveth/ui-design-system@^1.8.8":
version "1.8.12"
resolved "https://registry.yarnpkg.com/@giveth/ui-design-system/-/ui-design-system-1.8.12.tgz#07f57c78fa865a352f9250c4d7c05af56f6d55d0"
integrity sha512-ixJahC1YuQD1DFfYNsIB2N+B7JHjm8n0XZBZ6w2Yv6kL13fYxIAsHHNCe6Ql6dmjTnlI7NzO3uEZweMTQi28zA==
"@giveth/ui-design-system@^1.8.22":
version "1.8.22"
resolved "https://registry.yarnpkg.com/@giveth/ui-design-system/-/ui-design-system-1.8.22.tgz#0b58f1b2ff6570a5cae2467765f0bcfd5d250313"
integrity sha512-KbFijCEQUV1kaVfJA5ZNSA4ecXIr8VKzizuh0m1BF3X08WQ/kfzmoow9tadLYszQE7/E2sGsqbboGeHh/3+v+w==
dependencies:
next "12.0.7"
react "17.0.2"
Expand Down

1 comment on commit fa94f0b

@vercel
Copy link

@vercel vercel bot commented on fa94f0b Sep 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

giveth-dapps-v2 – ./

giveth-dapps-v2-git-main-givethio.vercel.app
giveth.io
www.giveth.io
giveth-dapps-v2-givethio.vercel.app

Please sign in to comment.