Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e3bf1d2
feat: add referrals page to app routes
paulchristianprieto May 5, 2023
010f0a2
feat: add new type of text that has no set color
paulchristianprieto May 10, 2023
ec3b229
feat: referrals page
paulchristianprieto May 10, 2023
07aae8b
feat: add links
paulchristianprieto May 16, 2023
47fde44
referral code error and success message
paulchristianprieto May 17, 2023
e015afb
add comments for api integration
paulchristianprieto May 17, 2023
abdc975
update twitter tweet message
paulchristianprieto May 17, 2023
87ffdbb
feat: API integration of referrals page
paulchristianprieto May 18, 2023
b425fa6
delete console log
paulchristianprieto May 18, 2023
6c92d24
feat: integrate workflow for adding referrer
paulchristianprieto May 18, 2023
84b5b85
feat: handle toggling the wallet modal and handle error when user alr…
paulchristianprieto May 19, 2023
1fd1f48
feat: check referral code if it exist upon creating
paulchristianprieto May 19, 2023
f3e0b07
delete referral code from context value
paulchristianprieto May 19, 2023
4d268c6
Merge branch 'staging' into referrals-page
paulchristianprieto May 22, 2023
a90a93c
include referrals page on the burger menu on mobile screen
paulchristianprieto May 22, 2023
15d6abd
use referrals staging api
paulchristianprieto May 23, 2023
b2c9e56
use debounced referral code
paulchristianprieto May 23, 2023
4246f1c
delete comments
paulchristianprieto May 23, 2023
d8089ee
Merge branch 'staging' into referrals-page
paulchristianprieto May 23, 2023
598e429
disable copy icon when getting user data is loading
paulchristianprieto May 23, 2023
27cb2eb
disable onClick function of Icon when disabled
paulchristianprieto May 23, 2023
83d3f16
delete console log
paulchristianprieto May 24, 2023
4a906cd
checkpoint
paulchristianprieto May 26, 2023
4414cb5
polish referral code input flow
paulchristianprieto May 27, 2023
38fde03
Merge branch 'staging' into referrals-page
paulchristianprieto Jun 5, 2023
4b612fb
Merge branch 'staging' into referrals-page
paulchristianprieto Jun 9, 2023
ec7a696
add loading screen for affiliates tab
paulchristianprieto Jun 12, 2023
4576d7e
feat: referral contract interaction and get affiliate from URL
EperezOk Nov 29, 2023
44e4ef9
feat: add dashboard with subgraph data
EperezOk Nov 29, 2023
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"no-debugger": "off"
}
},
"workbench.colorTheme": "Night Owl",
"workbench.colorTheme": "Community Material Theme Palenight High Contrast",
"workbench.iconTheme": "material-icon-theme",
"breadcrumbs.enabled": true,
"grunt.autoDetect": "off",
Expand Down
7 changes: 7 additions & 0 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ export default function Header() {
<TEXT.Menu>Bridge</TEXT.Menu>
</Trans>
</StyledLink>

<StyledLink to={'/referrals'}>
<Trans>
<TEXT.Menu>Referrals</TEXT.Menu>
</Trans>
</StyledLink>

{/* <StyledLink to={'/claimpage'}>
<Trans>
<TEXT.Menu>Claim</TEXT.Menu>
Expand Down
8 changes: 6 additions & 2 deletions src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const IconWrapper = styled.div<{
color?: string
transform?: string
clickable?: boolean
disabled?: boolean
position?: string
top?: string
right?: string
Expand All @@ -26,6 +27,7 @@ const IconWrapper = styled.div<{
left: ${({left}) => left ?? left};
bottom: ${({bottom}) => bottom ?? bottom};
position: ${({position}) => (position ? position : 'auto')};
${({disabled, theme}) => (disabled ? `color: ${theme.dark.grey2};` : '')};
`

type IconProps = {
Expand All @@ -35,6 +37,7 @@ type IconProps = {
color?: string
transform?: string
clickable?: boolean
disabled?: boolean
onClick?: (event: any) => any
top?: string
right?: string
Expand All @@ -43,15 +46,16 @@ type IconProps = {
position?: string
}

export const Icon = ({size, margin, children, color, transform, clickable, onClick, top, right, left, bottom, position}: IconProps) => {
export const Icon = ({size, margin, children, color, transform, clickable, onClick, top, right, left, bottom, position, disabled}: IconProps) => {
return (
<IconWrapper
size={size}
margin={margin}
color={color}
transform={transform}
clickable={clickable}
onClick={onClick}
disabled={disabled}
onClick={disabled ? () => null : onClick}
top={top}
right={right}
left={left}
Expand Down
90 changes: 90 additions & 0 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import React from 'react'
import styled from 'styled-components/macro'
import {TEXT} from '../../theme/theme'

const StyledInput = styled.input<{
error?: boolean
fontSize?: string
fontWeight?: string
align?: string
height?: string
padding?: string
}>`
color: ${({error, theme}) => (error ? theme.dark.red : theme.dark.white)};
width: 100%;
position: relative;
font-weight: 500;
outline: none;
border: none;
flex: 1 1 auto;
background-color: transparent;
font-family: 'Inter', sans-serif;
font-size: ${({fontSize}) => fontSize ?? '16px'};
font-weight: ${({fontWeight}) => fontWeight ?? '400'};
text-align: ${({align}) => align && align};
height: ${({height}) => (height ? height : 'auto')};
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: ${({padding}) => padding ?? '0px 8px'};
-webkit-appearance: textfield;

::-webkit-search-decoration {
-webkit-appearance: none;
}

[type='number'] {
-moz-appearance: textfield;
}

::-webkit-outer-spin-button,
::-webkit-inner-spin-button {
-webkit-appearance: none;
}

::placeholder {
opacity: 0.8;
}
`

export const Input = React.memo(function InnerInput({
value,
onUserInput,
placeholder,
prependSymbol,
height,
padding,
...rest
}: {
value: string | number | undefined
onUserInput: (input: string) => void
error?: boolean
fontSize?: string
fontWeight?: string
align?: 'right' | 'left'
height?: string
padding?: string
prependSymbol?: string | undefined
} & Omit<React.HTMLProps<HTMLInputElement>, 'ref' | 'onChange' | 'as'>) {
const enforcer = (nextUserInput: string) => {
onUserInput(nextUserInput)
}

return (
<StyledInput
{...rest}
value={value}
onChange={event => {
enforcer(event.target.value)
}}
inputMode="decimal"
autoComplete="off"
autoCorrect="off"
// text-specific options
type="text"
placeholder={placeholder || ''}
height={height}
padding={padding}
/>
)
})
5 changes: 5 additions & 0 deletions src/components/Popup/TransactionPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export default function TransactionPopup({hash, success, summary, info}: {hash:
</ErrorMessage>
)} */}

{/* Referral Error Messages */}
{chainId && info?.message === 'referral code does not exist' && <ErrorMessage>Referral code does not exist.</ErrorMessage>}
{chainId && info?.message === 'referral code of user already used' && <ErrorMessage>User already have a referral code.</ErrorMessage>}
{chainId && info?.message === 'referral code successfully used' && <TEXT.BoldSmallBody>Referral code successfully used.</TEXT.BoldSmallBody>}

{chainId && hash && success && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
<ExternalLinkContentsContainer>
Expand Down
4 changes: 4 additions & 0 deletions src/components/SlideMenu/SlideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ const SlideMenu = ({open, setOpen, ...props}: {open: boolean; setOpen: Function;
<StyledInternalLink tabIndex={tabIndex} to={'/positions'}>
<StyledMenuLink displayText={'Positions'} linkDestination={'/positions'} currentLocation={location} />
</StyledInternalLink>
<StyledInternalLink tabIndex={tabIndex} to={'/referrals'}>
<StyledMenuLink displayText={'Referrals'} linkDestination={'/referrals'} currentLocation={location} />
</StyledInternalLink>

<Separator />

<StyledExternalLink href="https://overlay.market">Risks</StyledExternalLink>
Expand Down
5 changes: 5 additions & 0 deletions src/components/Web3Status/Web3Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export const NETWORK_LABELS: {[chainId in SupportedChainId | number]: string} =
[SupportedChainId.RINKEBY]: 'Rinkeby Testnet',
[SupportedChainId.ARBITRUM]: 'Arbitrum One',
[SupportedChainId.ARBITRUM_GÖRLI]: 'Arbitrum Goerli Testnet',
[SupportedChainId.ARBITRUM_SEPOLIA]: 'Arbitrum Sepolia Testnet',
}

function Web3StatusInner() {
Expand Down Expand Up @@ -210,6 +211,10 @@ function Web3StatusInner() {
{chainId && NETWORK_LABELS[chainId] === NETWORK_LABELS[SupportedChainId.ARBITRUM_GÖRLI] && (
<Dropdown connectedNetwork={NETWORK_LABELS[chainId]} colorStatus={'yellow'} />
)}

{chainId && NETWORK_LABELS[chainId] === NETWORK_LABELS[SupportedChainId.ARBITRUM_SEPOLIA] && (
<Dropdown connectedNetwork={NETWORK_LABELS[chainId]} colorStatus={'yellow'} />
)}
</Account>
</Web3StatusConnected>
)
Expand Down
4 changes: 3 additions & 1 deletion src/connectors/connectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const SUPPORTED_CHAIN_IDS: SupportedChainId[] = [
SupportedChainId.RINKEBY,
SupportedChainId.ARBITRUM,
SupportedChainId.ARBITRUM_GÖRLI,
SupportedChainId.ARBITRUM_SEPOLIA,
]

export const injected = new InjectedConnector({
Expand All @@ -35,11 +36,12 @@ export const NETWORK_URLS: {[key in SupportedChainId]: string} = {
// [SupportedChainId.ARBITRUM]: `https://arbitrum-mainnet.infura.io/v3/${INFURA_KEY}`,
[SupportedChainId.ARBITRUM]: `https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`,
[SupportedChainId.ARBITRUM_GÖRLI]: `https://arbitrum-goerli.infura.io/v3/${INFURA_KEY}`,
[SupportedChainId.ARBITRUM_SEPOLIA]: `https://arbitrum-sepolia.infura.io/v3/${INFURA_KEY}`,
}

export const network = new NetworkConnector({
urls: NETWORK_URLS,
defaultChainId: SupportedChainId.ARBITRUM,
defaultChainId: SupportedChainId.ARBITRUM_SEPOLIA,
})

let networkLibrary: Web3Provider | undefined
Expand Down
Loading