Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewards V1 #1664

Merged
merged 68 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
875bb79
added rewards module
rohitmalhotra1420 Jun 17, 2024
47654c1
added /rewards route and changed the snap section in dashboard (#1647)
mishramonalisha76 Jun 17, 2024
4d3e1d7
rewards tabs + dashboard tab ui
rohitmalhotra1420 Jun 17, 2024
cf7d158
Merge branch 'rewardsV1' of github.com:push-protocol/push-dapp into r…
rohitmalhotra1420 Jun 17, 2024
457b969
fixed ui
rohitmalhotra1420 Jun 17, 2024
e99f887
added leadership board UI
rohitmalhotra1420 Jun 17, 2024
5565899
fixed the colors
rohitmalhotra1420 Jun 17, 2024
61bbdb3
fixed border radius
rohitmalhotra1420 Jun 17, 2024
ac6d167
Activities tab UI - Rewards page (#1651)
corlard3y Jun 19, 2024
356c406
added lozenge and leaderboard tab (#1653)
mishramonalisha76 Jun 19, 2024
34c96d4
Leaderboard api (#1658)
mishramonalisha76 Jun 21, 2024
bcd05ed
API Integration of Rewards Activities (#1659)
abhishek-01k Jun 22, 2024
d14ba3a
chore: add image
corlard3y Jun 22, 2024
4cdc257
prop fixed
rohitmalhotra1420 Jun 24, 2024
800fb05
Update image name
corlard3y Jun 24, 2024
e6ba132
fixed the file name
rohitmalhotra1420 Jun 24, 2024
6b94bd9
Merge branch 'rewardsV1' of github.com:push-protocol/push-dapp into r…
rohitmalhotra1420 Jun 24, 2024
35696e3
added none type to border type
rohitmalhotra1420 Jun 24, 2024
fdb3fe6
mapped the url and name in the response for the activities and also f…
abhishek-01k Jun 24, 2024
e57705b
update initial commits
corlard3y Jun 24, 2024
e283e77
update routes && fix other comments
corlard3y Jun 24, 2024
ea5c21a
update rewards page
corlard3y Jun 25, 2024
fc427fd
Fixed some of the comments
abhishek-01k Jun 25, 2024
6209e2e
add base-url
corlard3y Jun 25, 2024
2931122
update unused variables
corlard3y Jun 25, 2024
9741d0e
fix design qa
corlard3y Jun 25, 2024
4b21578
update design fixes
corlard3y Jun 25, 2024
2610c1f
remove usegenerateuserid files && fixes
corlard3y Jun 25, 2024
60e5f2f
fix loader
corlard3y Jun 25, 2024
fd874e5
update text width
corlard3y Jun 25, 2024
1ff3ca1
added support for align self in box
rohitmalhotra1420 Jun 26, 2024
bf7ffef
added custom hook for discird session
rohitmalhotra1420 Jun 26, 2024
637197c
replaced custom hook with useSearchParams hook
rohitmalhotra1420 Jun 26, 2024
fd533b5
removed log
rohitmalhotra1420 Jun 26, 2024
1aeb850
fixed types
rohitmalhotra1420 Jun 26, 2024
cfa1708
Twitter Integration in the rewards (#1672)
abhishek-01k Jun 26, 2024
296fb59
Merge branch 'rewardsV1' of github.com:push-protocol/push-dapp into r…
rohitmalhotra1420 Jun 26, 2024
7ca2ad5
Merge branch 'main' of github.com:push-protocol/push-dapp into rewardsV1
rohitmalhotra1420 Jun 26, 2024
883f97b
fix button min-width
rohitmalhotra1420 Jun 26, 2024
3b4f92b
Client Id for discord
abhishek-01k Jun 26, 2024
d366985
Updated Preview.yml file
abhishek-01k Jun 26, 2024
14f22e8
added support for rewards base URL
rohitmalhotra1420 Jun 26, 2024
8045ce2
Merge branch 'rewardsV1' of github.com:push-protocol/push-dapp into r…
rohitmalhotra1420 Jun 26, 2024
2bf530f
add userGenerateUser hook
corlard3y Jun 26, 2024
6275129
Fixed the Connect and User Profile Modal on rewards page
abhishek-01k Jun 26, 2024
53f6f73
fix onboard text
corlard3y Jun 26, 2024
6bc5d43
add pagewrapper
corlard3y Jun 26, 2024
ed4280d
add base path
corlard3y Jun 26, 2024
4f6571b
update preview url
corlard3y Jun 26, 2024
93b0a70
add base
corlard3y Jun 26, 2024
50bf21c
remove unused helper
corlard3y Jun 26, 2024
5b7d8c8
layout and refeactor
rohitmalhotra1420 Jun 27, 2024
98e5d5e
fixed dashboard layout
rohitmalhotra1420 Jun 27, 2024
889903e
staging URL updated for points
rohitmalhotra1420 Jun 27, 2024
0598c08
fixed the firebase configs
rohitmalhotra1420 Jun 27, 2024
1b7f0a4
changed vapid keys for firebase
rohitmalhotra1420 Jun 27, 2024
2e5f0cf
reverted back to firebase config of the app
rohitmalhotra1420 Jun 28, 2024
4afb6e1
Merge branch 'main' of github.com:push-protocol/push-dapp into rewardsV1
rohitmalhotra1420 Jun 28, 2024
137af15
fixed export issues
rohitmalhotra1420 Jun 28, 2024
7c786fb
Fixed the URL issue with the discord
abhishek-01k Jul 1, 2024
f43e2f8
fixed merge conflicts with main
mishramonalisha76 Jul 1, 2024
639e459
added points/vault routes (#1683)
mishramonalisha76 Jul 1, 2024
7be195f
Points login page (#1687)
mishramonalisha76 Jul 2, 2024
ace3063
Removed the loading state in the button and added the disabled label …
abhishek-01k Jul 2, 2024
aee92e6
Added Pagination for Activities Page (#1688)
abhishek-01k Jul 3, 2024
34d01e8
Add Vault List (#1689)
kalashshah Jul 3, 2024
66bcd1b
Merge branch 'main' of github.com:push-protocol/push-dapp into rewardsV1
rohitmalhotra1420 Jul 3, 2024
123d048
added min-width to buttons
rohitmalhotra1420 Jul 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ VITE_APP_PUBLIC_URL=https://dev.push.org/
# WALLET CONNECT PROJECT ID
VITE_APP_WALLETCONNECT_PROJECT_ID=walletconnect_project_id

# Discord Client ID
VITE_APP_DISCORD_CLIENT_ID=client_id

# LOCALHOST CREDS
# VITE_APP_IPFS_INFURA_API_KEY="your_secret_infura_api_key_for_localhost"
# VITE_APP_IPFS_INFURA_API_SECRET="your_secret_infura_api_secret_for_localhost"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed
env:
VITE_APP_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_APP_WALLETCONNECT_PROJECT_ID }}

VITE_APP_DISCORD_CLIENT_ID: ${{ secrets.VITE_APP_DISCORD_CLIENT_ID }}
run: |
yarn install
yarn build:pr:preview
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"assert": "2.0.0",
"babel-plugin-styled-components": "1.10.7",
"blockies": "0.0.2",
"blockies-react-svg": "^0.0.13",
"browserify-zlib": "^0.2.0",
"browserslist": "4.14.6",
"buffer": "6.0.3",
Expand All @@ -75,6 +76,8 @@
"eth-crypto": "1.6.0",
"eth-sig-util": "^3.0.1",
"ethers": "^5.7.2",
"firebase": "^10.12.2",
"formik": "^2.4.6",
"https-browserify": "1.0.0",
"image-size": "0.9.3",
"immer": "^10.0.2",
Expand All @@ -97,6 +100,7 @@
"react-ga": "2.7.0",
"react-icons": "4.12.0",
"react-image-file-resizer": "^0.4.7",
"react-infinite-scroller": "^1.2.6",
"react-joyride": "^2.4.0",
"react-multi-select-component": "^4.2.3",
"react-player": "^2.16.0",
Expand All @@ -115,7 +119,8 @@
"styled-components": "^5.3.8",
"url": "0.11.0",
"web3": "^1.8.2",
"xss": "^1.0.14"
"xss": "^1.0.14",
"yup": "^1.4.0"
},
"devDependencies": {
"@3id/connect": "0.4.1",
Expand All @@ -125,6 +130,7 @@
"@types/openpgp": "^4.4.18",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@types/react-infinite-scroller": "^1",
"@types/styled-components": "5.1.26",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
Expand Down
24 changes: 15 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import SpaceContextProvider from 'contexts/SpaceContext';
import { SpaceWidgetSection } from 'sections/space/SpaceWidgetSection';
import { blocksColors } from 'blocks';
import { textVariants } from 'blocks/text/Text.constants';
import APP_PATHS from 'config/AppPaths';

dotenv.config();

Expand Down Expand Up @@ -327,7 +328,8 @@ export default function App() {
// const { spaceUI } = useSpaceComponents();

const location = useLocation();
const isSnapPage = location?.pathname.includes('/snap');
const isHeaderHidden = location?.pathname.includes(APP_PATHS.PointsVault);
const isSidebarHidden = location?.pathname.includes(APP_PATHS.PointsVault) || location?.pathname.includes('/snap');

return (
<ThemeProvider theme={darkMode ? themeDark : themeLight}>
Expand Down Expand Up @@ -379,15 +381,17 @@ export default function App() {
}}
/>

<HeaderContainer>
<Header
isDarkMode={darkMode}
darkModeToggle={toggleDarkMode}
/>
</HeaderContainer>
{!isHeaderHidden && (
<HeaderContainer>
<Header
isDarkMode={darkMode}
darkModeToggle={toggleDarkMode}
/>
</HeaderContainer>
)}

<ParentContainer headerHeight={GLOBALS.CONSTANTS.HEADER_HEIGHT}>
{!isSnapPage && (
{!isSidebarHidden && (
<LeftBarContainer
leftBarWidth={
sidebarCollapsed
Expand All @@ -401,7 +405,9 @@ export default function App() {

<ContentContainer
leftBarWidth={
sidebarCollapsed
isSidebarHidden
? GLOBALS.CONSTANTS.NO_LEFT_BAR_WIDTH
: sidebarCollapsed
? GLOBALS.CONSTANTS.COLLAPSABLE_RIGHT_BAR_WIDTH
: GLOBALS.CONSTANTS.LEFT_BAR_WIDTH
}
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/Blocks.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type Breakpoint = 'initial' | 'ms' | 'mm' | 'ml' | 'tb' | 'lp' | 'll' | '

export type ResponsiveProp<T> = T | { [key in Breakpoint]?: T };

export type RadiusType = `r${number}`;
export type RadiusType = `r${number}` | `r${number} r${number}` | `r${number} r${number} r${number} r${number}`;

export type SpaceType = `s${number}` | `s${number} s${number}` | `s${number} s${number} s${number} s${number}`;

Expand Down Expand Up @@ -59,7 +59,7 @@ export type ThemeMode = 'light' | 'dark';

export type ThemeModeColors = Record<ThemeMode, BlocksColors>;

export type BorderValue = `${number}px ${string} ${BlocksColors}`;
export type BorderValue = `${number}px ${string} ${BlocksColors}` | 'none';

export type ThemeModeBorder = Record<ThemeMode, BorderValue>;

Expand Down
17 changes: 16 additions & 1 deletion src/blocks/Blocks.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
ResponsiveCSSPropertyData,
ThemeMode,
ThemeModeBorder,
BorderValue
BorderValue,
RadiusType
} from './Blocks.types';

/**
Expand Down Expand Up @@ -166,3 +167,17 @@ export const getBlocksBorder = (mode: ThemeMode, border?: BorderValue | ThemeMod
borderValues[2] = `var(--${borderValues[2]})`;
return borderValues.join(' ');
};

/**
* @param radius
* @returns
*/
export const getBlocksBorderRadius = (radius?: RadiusType) => {
// If border-radius is not given return undefined, to avoid any breakages
if (!radius) return radius;

return radius.replace(/\b(\w+)\b/g, 'var(--$1)');

// If passed a design system border-radius then use radius as a variable
return `var(--${radius})`;
};
1 change: 1 addition & 0 deletions src/blocks/box/Box.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const boxRestrictedCSSPropKeys: (keyof BoxCSSProps | keyof ModeProp)[] =
'position',
'boxShadow',
'alignItems',
'alignSelf',
'display',
'flexDirection',
'gap',
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';

import { useBlocksTheme } from '../Blocks.hooks';
import { TransformedHTMLAttributes, ModeProp } from '../Blocks.types';
import { getBlocksColor, getBlocksBorder } from '../Blocks.utils';
import { getBlocksColor, getBlocksBorder, getBlocksBorderRadius } from '../Blocks.utils';
import { BoxCSSProps, BoxComponentProps } from './Box.types';
import { getBoxResponsiveCSS } from './Box.utils';
import { boxRestrictedCSSPropKeys } from './Box.constants';
Expand All @@ -13,15 +13,15 @@ export type BoxProps = BoxCSSProps & BoxComponentProps & TransformedHTMLAttribut
const StyledBox = styled.div.withConfig({
shouldForwardProp: (prop, defaultValidatorFn) =>
!boxRestrictedCSSPropKeys.includes(prop as keyof BoxCSSProps) && defaultValidatorFn(prop),
}) <BoxProps & ModeProp>`
})<BoxProps & ModeProp>`
/* Responsive props */
${(props) => getBoxResponsiveCSS(props)}

/* Non-responsive props */
color: ${(props) => getBlocksColor(props.mode, props.color)};
background-color: ${(props) => getBlocksColor(props.mode, props.backgroundColor)};
box-shadow: ${(props) => props.boxShadow};
border-radius: ${(props) => props.borderRadius};
border-radius: ${(props) => getBlocksBorderRadius(props.borderRadius)};
cursor: ${(props) => props.cursor};
overflow: ${(props) => props.overflow};
border: ${(props) => getBlocksBorder(props.mode, props.border)};
Expand Down
6 changes: 5 additions & 1 deletion src/blocks/box/Box.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CSSProperties, ReactNode } from 'react';
import {
BlocksColors,
BorderValue,
RadiusType,
ResponsiveProp,
SpaceType,
ThemeModeBorder,
Expand All @@ -14,6 +15,8 @@ import { FlattenSimpleInterpolation } from 'styled-components';
export type BoxResponsiveProps = {
/* Sets align-items css property */
alignItems?: ResponsiveProp<CSSProperties['alignItems']>;
/* Sets align-self css property */
alignSelf?: ResponsiveProp<CSSProperties['alignSelf']>;
/* Sets flex-direction css property */
flexDirection?: ResponsiveProp<CSSProperties['flexDirection']>;
/* Sets gap between the elements */
Expand Down Expand Up @@ -44,7 +47,7 @@ export type BoxNonResponsiveProps = {
/* Sets border css property */
border?: BorderValue | ThemeModeBorder;
/* Sets border-radius css property */
borderRadius?: string;
borderRadius?: RadiusType;
/* Sets background-color css property */
backgroundColor?: BlocksColors | ThemeModeColors;
/* Sets color css property */
Expand Down Expand Up @@ -74,6 +77,7 @@ export type BoxComponentProps = {

export type BoxResponsiveCSSProperties =
| 'align-items'
| 'align-self'
| 'display'
| 'flex-direction'
| 'gap'
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/box/Box.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BoxResponsiveCSSPropertiesData, BoxResponsiveProps } from './Box.types'

const getBoxResponsiveCSSProperties = (props: BoxResponsiveProps): BoxResponsiveCSSPropertiesData[] => [
{ propName: 'align-items', prop: props.alignItems },
{ propName: 'align-self', prop: props.alignSelf },
{ propName: 'display', prop: props.display },
{ propName: 'flex-direction', prop: props.flexDirection },
{ propName: 'gap', prop: props.gap },
Expand All @@ -14,7 +15,7 @@ const getBoxResponsiveCSSProperties = (props: BoxResponsiveProps): BoxResponsive
{ propName: 'max-width', prop: props.maxWidth },
{ propName: 'min-width', prop: props.minWidth },
{ propName: 'padding', prop: props.padding },
{ propName: 'width', prop: props.width }
{ propName: 'width', prop: props.width },
];

export const getBoxResponsiveCSS = (props: BoxResponsiveProps) => {
Expand Down
4 changes: 4 additions & 0 deletions src/blocks/button/Button.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export const getButtonSizeStyles = ({
gap: var(--s1);
height: 32px;
padding: var(--s3) var(--s4);
min-width: 100px;
`}

/* Button text size css */
Expand Down Expand Up @@ -224,6 +225,7 @@ export const getButtonSizeStyles = ({
gap: var(--s1);
height: 40px;
padding: var(--s3) var(--s6);
min-width: 100px;
`}

/* Button text size css */
Expand Down Expand Up @@ -263,6 +265,7 @@ export const getButtonSizeStyles = ({
gap: var(--s1);
height: 48px;
padding: var(--s4) var(--s6);
min-width: 100px;
`}

/* Button text size css */
Expand Down Expand Up @@ -301,6 +304,7 @@ export const getButtonSizeStyles = ({
gap: var(--s1);
height: 52px;
padding: var(--s4) var(--s8);
min-width: 100px;
`}

/* Button text size css */
Expand Down
21 changes: 16 additions & 5 deletions src/blocks/hoverableSVG/HoverableSVG.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { FC } from 'react';
import styled from 'styled-components';
import { useBlocksTheme } from '../Blocks.hooks';
import { BlocksColors, ThemeModeColors, SpaceType, ModeProp, TransformedHTMLAttributes } from '../Blocks.types';
import { getBlocksColor } from '../Blocks.utils';
import {
BlocksColors,
ThemeModeColors,
SpaceType,
ModeProp,
TransformedHTMLAttributes,
RadiusType,
} from '../Blocks.types';
import { getBlocksColor, getBlocksBorderRadius } from '../Blocks.utils';
export type HoverableSVGProps = {
/* Icon component */
icon: React.ReactNode;
Expand All @@ -20,17 +27,19 @@ export type HoverableSVGProps = {
padding?: SpaceType;
/* Sets the margin for SVG button container */
margin?: SpaceType;
/* Sets the margin for SVG button container */
borderRadius?: RadiusType;
} & TransformedHTMLAttributes<HTMLButtonElement>;


const StyledButton = styled.button.withConfig({
shouldForwardProp: (prop, defaultValidatorFn) => !['mode'].includes(prop) && defaultValidatorFn(prop),
}) <Omit<HoverableSVGProps, 'icon'> & ModeProp>`
})<Omit<HoverableSVGProps, 'icon'> & ModeProp>`
display: inline-flex;
align-items: center;
justify-content: center;
padding: var(--${(props) => props.padding || 's0'});
margin: var(--${(props) => props.margin || 's0'});
border-radius: ${(props) => getBlocksBorderRadius(props.borderRadius)};
background-color: ${({ defaultBackground, mode }) => getBlocksColor(mode, defaultBackground) || 'transparent'};
color: ${({ mode, defaultColor }) => getBlocksColor(mode, defaultColor) || 'inherit'};
border: none;
Expand All @@ -54,6 +63,7 @@ const HoverableSVG: FC<HoverableSVGProps> = ({
hoverBackground,
padding,
margin,
borderRadius,
...props
}) => {
const { mode } = useBlocksTheme();
Expand All @@ -66,11 +76,12 @@ const HoverableSVG: FC<HoverableSVGProps> = ({
hoverBackground={hoverBackground}
padding={padding}
margin={margin}
borderRadius={borderRadius}
mode={mode}
{...props}
>
{icon}
</StyledButton>
);
};
export { HoverableSVG };
export { HoverableSVG };
30 changes: 30 additions & 0 deletions src/blocks/icons/components/Star.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { FC } from 'react';
import { IconWrapper } from '../IconWrapper';
import { IconProps } from '../Icons.types';

const Star: FC<IconProps> = (allProps) => {
const { svgProps: props, ...restProps } = allProps;
return (
<IconWrapper
componentName="Star"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 8 8"
fill="none"
{...props}
>
<path
d="M7.99998 4C8.00089 4.11726 7.96526 4.23189 7.89803 4.32796C7.8308 4.42403 7.73533 4.49676 7.62487 4.53604L5.35847 5.36047L4.53466 7.62719C4.49405 7.73662 4.42094 7.83099 4.32515 7.89764C4.22935 7.96428 4.11546 8 3.99878 8C3.8821 8 3.76821 7.96428 3.67241 7.89764C3.57662 7.83099 3.50351 7.73662 3.46291 7.62719L2.63909 5.36011L0.372692 4.53604C0.263301 4.49542 0.168956 4.42229 0.102333 4.32647C0.0357102 4.23064 0 4.11672 0 4C0 3.88328 0.0357102 3.76936 0.102333 3.67353C0.168956 3.57771 0.263301 3.50458 0.372692 3.46396L2.63909 2.63989L3.46291 0.372805C3.50351 0.263381 3.57662 0.169008 3.67241 0.102364C3.76821 0.0357211 3.8821 0 3.99878 0C4.11546 0 4.22935 0.0357211 4.32515 0.102364C4.42094 0.169008 4.49405 0.263381 4.53466 0.372805L5.35883 2.63989L7.62487 3.46396C7.73533 3.50324 7.8308 3.57597 7.89803 3.67204C7.96526 3.76811 8.00089 3.88274 7.99998 4Z"
fill="currentColor"
/>
</svg>
}
{...restProps}
/>
);
};

export default Star;
2 changes: 2 additions & 0 deletions src/blocks/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ export { default as SendNotificationFilled } from './components/SendNotification

export { default as Smiley } from './components/Smiley';

export { default as Star } from './components/Star';

export { default as Settings } from './components/Settings';

export { default as Swap } from './components/Swap';
Expand Down
Loading
Loading