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) Landing Page #138

Merged
merged 80 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
667c14e
(add) sanitize.css
gabitoesmiapodo Feb 18, 2021
aa188ac
Merge branch 'develop' into feature/#62-#74
gabitoesmiapodo Feb 18, 2021
df322cc
Merge branch 'develop' into feature/#62-#74
gabitoesmiapodo Feb 18, 2021
49b82f3
(fix) linting and general setup
gabitoesmiapodo Feb 18, 2021
494e921
(add) common components
gabitoesmiapodo Feb 18, 2021
fdb0982
(add) footer, header
gabitoesmiapodo Feb 18, 2021
8c00271
(fix) icon color
gabitoesmiapodo Feb 18, 2021
1610fec
(add) favicon
gabitoesmiapodo Feb 18, 2021
fa57fbe
Merge branch 'develop' into feature/#62-#74
gabitoesmiapodo Feb 19, 2021
8ed508d
Merge branch 'develop' into feature/#62-#74
gabitoesmiapodo Feb 19, 2021
d73ae0b
(Add) header user not connected styles
gabitoesmiapodo Feb 19, 2021
9633a73
(fix) footer styles
gabitoesmiapodo Feb 19, 2021
6db0f95
(add) header dropdown
gabitoesmiapodo Feb 19, 2021
2377a1c
(add) user address
gabitoesmiapodo Feb 19, 2021
f5a78f9
(add) user dropdown changes
gabitoesmiapodo Feb 20, 2021
2f6499a
(add) dropdown styles
gabitoesmiapodo Feb 22, 2021
3f46b35
(add) connect modal
gabitoesmiapodo Feb 22, 2021
0094a86
Merge branch 'develop' into feature/#62-#74
gabitoesmiapodo Feb 22, 2021
ea8ddec
(add) transactions modal
gabitoesmiapodo Feb 22, 2021
61eb992
(add) theme switch
gabitoesmiapodo Feb 22, 2021
9fbe801
(remove) unused component
gabitoesmiapodo Feb 22, 2021
ada07c4
(remove) more unused components
gabitoesmiapodo Feb 22, 2021
b981a00
(hide) theme toggle
gabitoesmiapodo Feb 23, 2021
67f9e79
Merge branch 'feature/#62-#74' into feature/#62
gabitoesmiapodo Feb 23, 2021
7504c58
Fix some linter errors
mariano-aguero Feb 23, 2021
5178c01
Update linter config
mariano-aguero Feb 23, 2021
005c475
Update yarn.lock
mariano-aguero Feb 23, 2021
d141aa5
Add engine
mariano-aguero Feb 23, 2021
577340d
Merge branch 'feature/#62-#74' into feature/#62
gabitoesmiapodo Feb 23, 2021
7a9b03c
(fix) linting
gabitoesmiapodo Feb 23, 2021
9cee120
Merge branch 'coolest-design-ever' into feature/#62
gabitoesmiapodo Feb 24, 2021
2a38d86
(remove) unused component
gabitoesmiapodo Feb 24, 2021
be7b491
(add) title, subtitle, copy button
gabitoesmiapodo Feb 24, 2021
a0f9b55
(add) auction details values
gabitoesmiapodo Feb 24, 2021
1097014
(add) tooltip
gabitoesmiapodo Feb 24, 2021
fc024ed
(add) external link button
gabitoesmiapodo Feb 24, 2021
b1ca7d9
(remove) unused dependency
gabitoesmiapodo Feb 24, 2021
017fd2d
(add) token icons
gabitoesmiapodo Feb 24, 2021
465d2ea
(add) separation
gabitoesmiapodo Feb 24, 2021
8100f8b
(add) base timer
gabitoesmiapodo Feb 24, 2021
db2b32d
Merge branch 'coolest-design-ever' into feature/#62
gabitoesmiapodo Feb 24, 2021
61e94c5
(refactor) timer code
gabitoesmiapodo Feb 24, 2021
a82986d
(add) text format
gabitoesmiapodo Feb 24, 2021
70d7e42
(add) timer and grid styles
gabitoesmiapodo Feb 25, 2021
801859f
(fix) auction progress
gabitoesmiapodo Feb 25, 2021
320b06b
(add) orders table
gabitoesmiapodo Feb 25, 2021
066ae63
(add) status icons
gabitoesmiapodo Feb 26, 2021
933a91b
(fix) crash
gabitoesmiapodo Feb 26, 2021
6598215
(add) missing auction state
gabitoesmiapodo Feb 26, 2021
9e3d6f9
Merge branch 'coolest-design-ever' into feature/#62
gabitoesmiapodo Feb 26, 2021
146bde3
(fix) linting
gabitoesmiapodo Feb 26, 2021
d2d5be5
(fix) make the auctions page less messy
gabitoesmiapodo Feb 26, 2021
0c04d43
(fix) several layout issues
gabitoesmiapodo Feb 26, 2021
1191e72
(add) spinner
gabitoesmiapodo Feb 26, 2021
79b4f6a
(add) buttons
gabitoesmiapodo Feb 26, 2021
509fac6
(add) token text
gabitoesmiapodo Feb 26, 2021
d1eb2e5
(add) amount input
gabitoesmiapodo Feb 26, 2021
5334f91
(add) price input
gabitoesmiapodo Feb 26, 2021
bc2ee72
(add) some checking
gabitoesmiapodo Feb 26, 2021
27d880e
(add) spinner for chart
gabitoesmiapodo Feb 26, 2021
b4bf78c
(add) approval text
gabitoesmiapodo Feb 26, 2021
3ea31fd
Merge branch 'coolest-design-ever' into feature/#62
gabitoesmiapodo Feb 26, 2021
a7846ff
(fix) fuckup
gabitoesmiapodo Feb 26, 2021
666a209
(fix) validations
gabitoesmiapodo Feb 26, 2021
fcdb71e
(fix) validations and folder placement
gabitoesmiapodo Feb 26, 2021
59ee2eb
(add) error display
gabitoesmiapodo Feb 26, 2021
3d0a104
(add) better errors
gabitoesmiapodo Feb 26, 2021
607b645
(add) some routes and placeholder sections
gabitoesmiapodo Mar 1, 2021
7a9dc02
Merge branch 'coolest-design-ever' into feature/#59
gabitoesmiapodo Mar 1, 2021
ea1ec7b
(update) gitignore
gabitoesmiapodo Mar 2, 2021
455d38c
(fix) gitignore
gabitoesmiapodo Mar 2, 2021
b830a06
(add) featured auctions loading spinner
gabitoesmiapodo Mar 2, 2021
3c25fe9
(add) landing page contents
gabitoesmiapodo Mar 2, 2021
0fbe086
(add) landing page contents
gabitoesmiapodo Mar 2, 2021
74079da
(add) featured auctions card styles
gabitoesmiapodo Mar 3, 2021
a2c0d5f
Merge commit 'ef224ef261d916d85b00c0875af98fb2d970dcea' into feature/#59
gabitoesmiapodo Mar 4, 2021
f6b6083
(update) yarn.lock
gabitoesmiapodo Mar 4, 2021
a64e94e
(add) featured actions progress bar
gabitoesmiapodo Mar 4, 2021
8355b7f
(fix) auction progress
gabitoesmiapodo Mar 4, 2021
c6a7ebf
(fix) scroll
gabitoesmiapodo Mar 4, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ package-lock.json
cypress/videos
cypress/screenshots
cypress/fixtures/example.json
.project
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"@reach/dialog": "^0.10.3",
"@reach/portal": "^0.10.3",
"@reduxjs/toolkit": "^1.3.5",
"@types/react-router-hash-link": "^1.2.1",
"@uniswap/sdk": "^2.0.5",
"@uniswap/token-lists": "^1.0.0-beta.19",
"@uniswap/v2-core": "1.0.0",
Expand Down Expand Up @@ -118,6 +119,7 @@
"react-popper": "^2.2.3",
"react-redux": "^7.2.0",
"react-router-dom": "^5.0.0",
"react-router-hash-link": "^2.4.0",
"react-scripts": "^4.0.1",
"react-spring": "^8.0.27",
"react-table": "^7.6.3",
Expand Down
192 changes: 0 additions & 192 deletions src/components/AuctionInfoCard/index.tsx

This file was deleted.

47 changes: 12 additions & 35 deletions src/components/auction/AuctionTimer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import {
useDerivedAuctionInfo,
useDerivedAuctionState,
} from '../../../state/orderPlacement/hooks'
import {
calculateTimeLeft,
calculateTimeProgress,
getDays,
getHours,
getMinutes,
getSeconds,
} from '../../../utils/tools'

const TIMER_SIZE = '154px'

Expand Down Expand Up @@ -106,22 +114,6 @@ const Blink = styled.span`
}
`

const getDays = (seconds: number): number => {
return Math.floor(seconds / 24 / 60 / 60) % 360
}

const getHours = (seconds: number): number => {
return Math.floor(seconds / 60 / 60) % 24
}

const getMinutes = (seconds: number): number => {
return Math.floor(seconds / 60) % 60
}

const getSeconds = (seconds: number): number => {
return Math.floor(seconds % 60)
}

const formatSeconds = (seconds: number): React.ReactNode => {
const days = getDays(seconds)
const hours = getHours(seconds)
Expand Down Expand Up @@ -156,23 +148,6 @@ const formatSeconds = (seconds: number): React.ReactNode => {
)
}

const calculateTimeLeft = (auctionEndDate: number) => {
if (isNaN(auctionEndDate)) return -1

const diff = auctionEndDate - Date.now() / 1000

if (diff < 0) return -1

return diff
}

const calculatePercentageLeft = (auctionStartDate: number, auctionEndDate: number): number => {
const totalAuctionDays = getDays(auctionEndDate - auctionStartDate / 1000)
const passedAuctionDays = totalAuctionDays - getDays(auctionEndDate - Date.now() / 1000)

return Math.trunc((passedAuctionDays * 100) / totalAuctionDays)
}

export const AuctionTimer = () => {
const { auctionState } = useDerivedAuctionState()
const { auctionEndDate, auctionStartDate } = useDerivedAuctionInfo()
Expand All @@ -188,13 +163,15 @@ export const AuctionTimer = () => {
}, [auctionEndDate])

return (
<Wrapper progress={`${calculatePercentageLeft(auctionStartDate, auctionEndDate)}%`}>
<Wrapper progress={calculateTimeProgress(auctionStartDate, auctionEndDate)}>
<Center>
{auctionState === undefined && <TextBig>Loading</TextBig>}
{auctionState === AuctionState.NOT_YET_STARTED && (
<TextBig>
Auction
<br /> not started
<br /> not
<br />
started
</TextBig>
)}
{(auctionState === AuctionState.ORDER_PLACING_AND_CANCELING ||
Expand Down
Loading