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

feature/guild #2167

Merged
merged 24 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c9786f3
Guild Token Lock (#1908)
Mi-Lan Jul 1, 2021
01419ea
feature/1861 (#1907)
hexyls Jul 3, 2021
20ffd3a
feature: add airdrop card to guild modal
hexyls Jul 20, 2021
4bd1cc3
fix: style changes, testing airdrop
hexyls Jul 21, 2021
f35e307
style: Reduce margin from 32px to 24px for diver and button group
Jul 21, 2021
c1781d3
fix: refetch claimable balance
hexyls Jul 22, 2021
e16145c
Merge branch 'feature/airdrop-guild-modal' of github.com:protofire/om…
hexyls Jul 22, 2021
9338323
fix: reset check address claim amount
hexyls Jul 22, 2021
a85e345
fix: display omen account on tight integration
hexyls Jul 22, 2021
76d783e
fix: capitalize wallet balance
hexyls Jul 22, 2021
f087c0b
feature: add airdrop for dxd holders
hexyls Jul 23, 2021
2b7959a
Add airdrop card to guild modal (#2112)
hexyls Jul 26, 2021
6ce1eae
Merge branch 'feature/guild' into fix/2114
hexyls Jul 28, 2021
80cbe2c
Merge branch 'feature/guild' into feature/2093
hexyls Jul 28, 2021
b0ffd3c
feature: redeploy both airdrops
hexyls Jul 28, 2021
464c75d
Combined (relay+eoa) OMN balance in header (#2139)
hexyls Aug 9, 2021
1539a8c
Merge pull request #2121 from protofire/fix/2114
hexyls Aug 10, 2021
39dce76
Merge branch 'feature/guild' into feature/2093
hexyls Aug 10, 2021
38f40d1
fix: fetch claims from github
hexyls Aug 10, 2021
f395fee
Merge branch 'feature/2093' of github.com:protofire/omen-exchange int…
hexyls Aug 10, 2021
2ecb1fb
fix: add claim recipient field
hexyls Aug 10, 2021
e2af478
Merge pull request #2122 from protofire/feature/2093
hexyls Aug 10, 2021
91947dc
Merge branch 'master' into feature/guild
hexyls Aug 11, 2021
a7b0679
fix: attempt to resolve merge issues, move code to cpk pipes
hexyls Aug 11, 2021
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
Next Next commit
Guild Token Lock (#1908)
* started working on lock tokens modal and added rinkeby omen address

* added rough outline for the omen guild membership modal

* started working on lock omen token modal

* added front-end fixes for lock omen token modal with input and made contents DRY as can be with new display feature i found

* small css adjustments

* some css to make row gaps

* started working on guild service

* tidied up omen guild service so it works and added two more functions

* made all data display

* started adjusting contracts and integrating it into cpk encountered minor block

* fixed guild service issue

* got lock function working

* fixes for the guild service and calculation

* added disabled button logic

* done with style details excluded grid

* added your vote weight percentage change and added unlock function along with changes to ethers sc stuff

* cleaned up unused code and abi

* added correct date formatting along with one missing abi

* added omen icons and fixed couple things

* handled cpk bug because of no relay

* fixed incorrect unlock calculation for timestamp

* added transaction modal and started looking into fixing cpk

* fixing transaction state modal issue

* added tooltip

* started workig on allowance logic

* approve button implemented with logic

* working in progress

* cracked motherfucker

* tidied up code and added check to fetch appropriate amounts if on mainnet versus other cases

* fixed type issue with transaction steps along with fex minor front-end fixes

* added null state for unlock date

* correct modal shows after transaction and balances update correctly

* fixed all comments

* fix for vote weight showing difference on incorrect place

* fix Button animation removed

* style Added hover styling for modal info icon and cursor

* test: Test for formatLockDate function

* style: Fixed bucnh of styling issue from Kadens comments

* fix: Removed all instances of getting omenTokenAddress directly from SC but made them fetched from knownTokens

* refactor: Deleted getOmenGuildContract and moved that logic into the constructor as suggested by Kaden

* fix: Fixed unlock tokens so they transfer token to address on xDai,leave it on cpk on tight and regular transfer on mainnet/rinkeby

* test: Added daysUntil test

Co-authored-by: Thomas Pulber <corkus@pm.me>
  • Loading branch information
Mi-Lan and pimato authored Jul 1, 2021
commit c9786f32a78fdd1a3d2e4d25ed1311e18e082430
1 change: 0 additions & 1 deletion app/src/components/button/button_styling_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export const ButtonCSS = css`
padding: 12px 17px;
pointer-events: ${props => ((props as any).disabled ? 'none' : 'initial')};
text-align: center;
transition: all 0.15s ease-out;
user-select: none;
white-space: nowrap;
font-family: Roboto;
Expand Down
27 changes: 24 additions & 3 deletions app/src/components/common/icons/IconAlertInverted.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
import React from 'react'
import styled from 'styled-components'

interface Props {
style?: any
size?: string
}

const StyledSvg = styled.svg`
cursor: pointer;
&:hover {
circle {
stroke: ${props => props.theme.dropdown.buttonBorderColorHover};
}
path {
fill: ${props => props.theme.dropdown.buttonColorHover};
}
}
`

export const IconAlertInverted = (props: Props) => {
const { style } = props
const { size = '20', ...restProps } = props
return (
<svg fill="none" height="20" style={style} viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">
<StyledSvg
{...restProps}
fill="none"
height={size}
viewBox="0 0 20 20"
width={size}
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="10" cy="10" r="9.5" stroke="#DCDFF2" />
<path
d="M9 14C9 13.4477 9.44772 13 10 13C10.5523 13 11 13.4477 11 14C11 14.5523 10.5523 15 10 15C9.44772 15 9 14.5523 9 14ZM9.12498 5H10.875V11H9.12498V5Z"
fill="#86909E"
/>
</svg>
</StyledSvg>
)
}
5 changes: 3 additions & 2 deletions app/src/components/common/icons/IconArrowBack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ const Wrapper = styled.svg<{ hoverEffect: boolean | undefined }>`
interface Props {
hoverEffect?: boolean
onClick?: () => void
style?: any
}

export const IconArrowBack = (props: Props) => {
const { hoverEffect = false, onClick } = props
const { hoverEffect = false, ...restProps } = props

return (
<Wrapper
fill="none"
height="24"
hoverEffect={hoverEffect}
onClick={onClick}
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
{...restProps}
>
<path
className="path"
Expand Down
36 changes: 27 additions & 9 deletions app/src/components/common/icons/IconArrowRightLong.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
import React from 'react'
import styled from 'styled-components'

export const IconArrowRightLong = () => (
<svg fill="none" height="14" viewBox="0 0 18 14" width="18" xmlns="http://www.w3.org/2000/svg">
<path
className="arrow-path"
d="M12.1163 0.928154C12.0593 0.860436 11.9887 0.805227 11.9091 0.766048C11.8294 0.726868 11.7423 0.704578 11.6535 0.700598C11.5646 0.696618 11.4759 0.711035 11.393 0.742931C11.3101 0.774827 11.2347 0.823501 11.1718 0.885851C11.109 0.9482 11.0599 1.02286 11.0277 1.10506C10.9955 1.18727 10.981 1.27522 10.985 1.3633C10.989 1.45139 11.0115 1.53768 11.051 1.61667C11.0905 1.69566 11.1462 1.76563 11.2145 1.8221L15.8153 6.38836H0.608036C0.443872 6.397 0.289304 6.46773 0.176181 6.58598C0.0630584 6.70423 0 6.86099 0 7.02396C0 7.18693 0.0630584 7.34369 0.176181 7.46194C0.289304 7.58019 0.443872 7.65092 0.608036 7.65955H15.8153L11.2073 12.2205C11.0913 12.3409 11.0266 12.5009 11.0266 12.6674C11.0266 12.8339 11.0913 12.994 11.2073 13.1144C11.2665 13.1732 11.3367 13.2199 11.4141 13.2517C11.4915 13.2836 11.5744 13.3 11.6582 13.3C11.742 13.3 11.8249 13.2836 11.9023 13.2517C11.9797 13.2199 12.0499 13.1732 12.1091 13.1144L17.8082 7.46467C17.8688 7.40679 17.9171 7.33737 17.9501 7.26057C17.983 7.18377 18 7.10116 18 7.0177C18 6.93424 17.983 6.85163 17.9501 6.77483C17.9171 6.69803 17.8688 6.62861 17.8082 6.57073L12.1163 0.928154Z"
fill="#DCDFF2"
/>
</svg>
)
interface Props {
width?: number
color?: string
height?: number
style?: any
}
const SvgStyled = styled.svg``
export const IconArrowRightLong = (props: Props) => {
const { color = '#DCDFF2', height = 14, style, width = 18 } = props
return (
<SvgStyled
fill="none"
height={height}
style={style}
viewBox="0 0 18 14"
width={width}
xmlns="http://www.w3.org/2000/svg"
>
<path
className="arrow-path"
d="M12.1163 0.928154C12.0593 0.860436 11.9887 0.805227 11.9091 0.766048C11.8294 0.726868 11.7423 0.704578 11.6535 0.700598C11.5646 0.696618 11.4759 0.711035 11.393 0.742931C11.3101 0.774827 11.2347 0.823501 11.1718 0.885851C11.109 0.9482 11.0599 1.02286 11.0277 1.10506C10.9955 1.18727 10.981 1.27522 10.985 1.3633C10.989 1.45139 11.0115 1.53768 11.051 1.61667C11.0905 1.69566 11.1462 1.76563 11.2145 1.8221L15.8153 6.38836H0.608036C0.443872 6.397 0.289304 6.46773 0.176181 6.58598C0.0630584 6.70423 0 6.86099 0 7.02396C0 7.18693 0.0630584 7.34369 0.176181 7.46194C0.289304 7.58019 0.443872 7.65092 0.608036 7.65955H15.8153L11.2073 12.2205C11.0913 12.3409 11.0266 12.5009 11.0266 12.6674C11.0266 12.8339 11.0913 12.994 11.2073 13.1144C11.2665 13.1732 11.3367 13.2199 11.4141 13.2517C11.4915 13.2836 11.5744 13.3 11.6582 13.3C11.742 13.3 11.8249 13.2836 11.9023 13.2517C11.9797 13.2199 12.0499 13.1732 12.1091 13.1144L17.8082 7.46467C17.8688 7.40679 17.9171 7.33737 17.9501 7.26057C17.983 7.18377 18 7.10116 18 7.0177C18 6.93424 17.983 6.85163 17.9501 6.77483C17.9171 6.69803 17.8688 6.62861 17.8082 6.57073L12.1163 0.928154Z"
fill={color}
/>
</SvgStyled>
)
}
25 changes: 20 additions & 5 deletions app/src/components/common/layout/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ import { matchPath } from 'react-router-dom'
import ReactTooltip from 'react-tooltip'
import styled, { css } from 'styled-components'

import { Network } from '../..'
import { Logo, STANDARD_DECIMALS } from '../../../../common/constants'
import { useConnectedWeb3Context } from '../../../../hooks'
import { networkIds } from '../../../../util/networks'
import { formatBigNumber } from '../../../../util/tools'
import { ExchangeType } from '../../../../util/types'
import { ButtonCircle, ButtonConnectWallet, ButtonRound } from '../../../button'
import { ModalConnectWalletWrapper, ModalDepositWithdrawWrapper, ModalYourConnectionWrapper } from '../../../modal'
import { Network } from '../../../common'
import {
ModalConnectWalletWrapper,
ModalDepositWithdrawWrapper,
ModalLockYoTokens,
ModalYourConnectionWrapper,
} from '../../../modal'
import { Dropdown, DropdownItemProps, DropdownPosition } from '../../form/dropdown'
import { IconAdd, IconClose, IconOmen } from '../../icons'
import { IconSettings } from '../../icons/IconSettings'
Expand Down Expand Up @@ -183,13 +188,15 @@ const OmenIconWrapper = styled.div`

const HeaderContainer: React.FC = (props: any) => {
const context = useConnectedWeb3Context()

const { relay, toggleRelay } = context
const { account, active, connectorName, error, networkId } = context.rawWeb3Context

const { history, ...restProps } = props
const [isConnectWalletModalOpen, setConnectWalletModalState] = useState(false)
const [isYourConnectionModalOpen, setYourConnectionModalState] = useState(false)
const [isDepositWithdrawModalOpen, setDepositWithdrawModalState] = useState(false)
const [isModalLockTokensOpen, setModalLockTokensState] = useState<boolean>(false)
const [depositWithdrawType, setDepositWithdrawType] = useState<ExchangeType>(ExchangeType.deposit)
const [marketPage, setMarketPage] = useState(true)

Expand Down Expand Up @@ -315,9 +322,8 @@ const HeaderContainer: React.FC = (props: any) => {
placeholder={networkPlacholder}
/>
)}

{account && (
<HeaderButton style={{ display: 'none' }}>
{account && networkId === networkIds.RINKEBY && (
<HeaderButton onClick={() => setModalLockTokensState(!isModalLockTokensOpen)}>
{relay
? `${formatBigNumber(xOmenBalance, STANDARD_DECIMALS, 0)}`
: `${formatBigNumber(omenBalance, STANDARD_DECIMALS, 0)}`}
Expand Down Expand Up @@ -365,6 +371,15 @@ const HeaderContainer: React.FC = (props: any) => {
<IconSettings />
</ButtonSettings>
</ContentsRight>
<ModalLockYoTokens
context={context}
fetchBalances={fetchBalances}
isOpen={isModalLockTokensOpen}
omenBalance={relay ? xOmenBalance : omenBalance}
onClose={() => setModalLockTokensState(false)}
setIsModalLockTokensOpen={setModalLockTokensState}
/>

<ModalYourConnectionWrapper
arrayOfClaimableBalances={arrayOfClaimableTokenBalances}
changeWallet={() => {
Expand Down
18 changes: 12 additions & 6 deletions app/src/components/market/common/new_value/img/ArrowIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React from 'react'

export const ArrowIcon: React.FC = () => (
<svg fill="none" height="8" viewBox="0 0 11 8" width="11" xmlns="http://www.w3.org/2000/svg">
<path d="M7.01 3H0V5H7.01V8L11 4L7.01 0V3Z" />
</svg>
)
interface Props {
color?: string
style?: any
}
export const ArrowIcon = (props: Props) => {
const { color = 'none' } = props
return (
<svg fill={color} height="8" style={props.style} viewBox="0 0 11 8" width="11" xmlns="http://www.w3.org/2000/svg">
<path d="M7.01 3H0V5H7.01V8L11 4L7.01 0V3Z" />
</svg>
)
}
1 change: 1 addition & 0 deletions app/src/components/modal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { ModalTransactionResult } from './modal_transaction_result'
export { ModalYourConnectionWrapper } from './modal_your_connection'
export { ModalDepositWithdrawWrapper } from './modal_deposit_withdraw'
export { ModalTransactionWrapper } from './modal_transaction'
export { ModalLockYoTokens } from './modal_lock_yo_tokens'
Loading