-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from tempfiles-Team/102-유지기간-및-다운로드-횟수-기능-구현
102 유지기간 및 다운로드 횟수 기능 구현
- Loading branch information
Showing
15 changed files
with
225 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
REACT_APP_BACKEND_BASEURL=https://api.tempfiles.ml | ||
REACT_APP_BACKEND_BASEURL=http://localhost:5000 | ||
# dev - http://localhost:5000 | ||
# main - https://tfb.minpeter.cf | ||
# main - https://api.tempfiles.ml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
import { RangeSlider } from '../RangeSlider'; | ||
import * as S from './styled'; | ||
|
||
type DownloadCountSliderProps = { | ||
downloadCount: number; | ||
setDownloadCount: any; | ||
}; | ||
|
||
export const DownloadCountSlider: React.FC<DownloadCountSliderProps> = ({ | ||
downloadCount, | ||
setDownloadCount, | ||
}) => ( | ||
<S.DownloadCountContainer> | ||
<S.SectionText>- 다운로드 횟수 - {downloadCount}번</S.SectionText> | ||
<RangeSlider | ||
min={1} | ||
max={100} | ||
defaultValue={1} | ||
onChange={(event) => setDownloadCount(event.target.value)} | ||
step={1} | ||
/> | ||
</S.DownloadCountContainer> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const DownloadCountContainer = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: 2rem; | ||
`; | ||
|
||
export const SectionText = styled.div` | ||
color: var(--color-text-primary); | ||
font-weight: 600; | ||
margin-bottom: 0.5rem; | ||
`; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
|
||
import * as S from './styled'; | ||
|
||
type ExpireTimeProps = { | ||
expireTimePlusButton: string[]; | ||
time: { day: number; hour: number; minute: number }; | ||
expireTime: number; | ||
setExpireTime: (expireTime: number) => void; | ||
}; | ||
|
||
export const ExpireTime: React.FC<ExpireTimeProps> = ({ | ||
expireTimePlusButton, | ||
setExpireTime, | ||
expireTime, | ||
time, | ||
}) => ( | ||
<S.ExpireTimeContainer> | ||
<S.ExpireTimeText> | ||
{time.day}일 {time.hour}시간 {time.minute}분 | ||
</S.ExpireTimeText> | ||
<section style={{ display: 'flex' }}> | ||
{expireTimePlusButton.map((i) => ( | ||
<S.ExpireTimeButton | ||
key={i} | ||
onClick={() => { | ||
const item = | ||
i.split(i.replace(/[^0-9]/g, ''))[1] === '시간' | ||
? Number(i.replace(/[^0-9]/g, '')) * 60 | ||
: i.split(i.replace(/[^0-9]/g, ''))[1] === '일' | ||
? Number(i.replace(/[^0-9]/g, '')) * 1440 | ||
: Number(i.replace(/[^0-9]/g, '')); | ||
setExpireTime(expireTime + item); | ||
}} | ||
> | ||
+{i} | ||
</S.ExpireTimeButton> | ||
))} | ||
</section> | ||
</S.ExpireTimeContainer> | ||
); | ||
//i.replace(/[^0-9]/g, '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const ExpireTimeContainer = styled.div` | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
margin-top: 2rem; | ||
`; | ||
|
||
export const ExpireTimeText = styled.div` | ||
flex: 1 1 auto; | ||
height: 4rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 2rem; | ||
font-weight: 700; | ||
border-radius: 8px; | ||
background: var(--color-backgorund-black); | ||
`; | ||
|
||
export const ExpireTimeButton = styled.div` | ||
padding: 0 1rem 0 1rem; | ||
margin: 0 0.5rem 0 0.5rem; | ||
font-size: 1.6rem; | ||
font-weight: 600; | ||
color: var(--color-text-primary); | ||
height: 4rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: var(--color-background-secondary); | ||
border-radius: 0.8rem; | ||
cursor: pointer; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.