-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
18 changed files
with
991 additions
and
17 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import React, { useCallback, useEffect, useRef, useState } from "react"; | ||
import { isEscKeyPressed } from "utils"; | ||
import styled from "styled-components"; | ||
|
||
type Props = React.HTMLAttributes<HTMLDivElement> & { | ||
order: Number; | ||
header: string; | ||
content: string; | ||
}; | ||
|
||
type State = { | ||
open: boolean; | ||
ref: ReturnType<typeof React.createRef<HTMLDivElement>>; | ||
}; | ||
|
||
const Collapse = ({ order, header, content, ...rest }: Props) => { | ||
const [open, setOpen] = useState<State["open"]>(false); | ||
const ref = useRef<HTMLDivElement>(null); | ||
|
||
return ( | ||
<CollapseLayout ref={ref} tabIndex={0} {...rest}> | ||
<CollapseHeader onClick={() => setOpen(!open)}> | ||
<div> | ||
<p>{order.toString().padStart(2, "0")}</p> | ||
<p>{header}</p> | ||
</div> | ||
<span className="material-symbols-outlined"> | ||
{open ? "arrow_upward" : "arrow_downward"} | ||
</span> | ||
</CollapseHeader> | ||
<CollapseContent> | ||
<div style={{ display: open ? "block" : "none" }}>{content}</div> | ||
</CollapseContent> | ||
</CollapseLayout> | ||
); | ||
}; | ||
|
||
const CollapseLayout = styled.div` | ||
border-top: 1px solid #b0a8fe; | ||
border-bottom: 1px solid #b0a8fe; | ||
width: 100%; | ||
`; | ||
|
||
const CollapseHeader = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 1rem 3rem; | ||
cursor: pointer; | ||
& > div { | ||
display: flex; | ||
& > p { | ||
color: #b0a8fe; | ||
margin: 0; | ||
} | ||
& > p + p { | ||
padding-left: 1rem; | ||
} | ||
} | ||
& > .material-symbols-outlined { | ||
color: #b0a8fe; | ||
} | ||
@media only screen and (max-width: 810px) { | ||
padding: 1rem 1.5rem; | ||
text-align: start; | ||
} | ||
`; | ||
|
||
const CollapseContent = styled.div` | ||
font-size: 16px; | ||
color: white; | ||
text-align: start; | ||
overflow: hidden; | ||
width: 90%; | ||
& > div { | ||
padding: 0 3rem 2rem 3rem; | ||
display: none; | ||
} | ||
@media only screen and (max-width: 810px) { | ||
font-size: 12px; | ||
} | ||
`; | ||
|
||
export default Collapse; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, { useCallback, useEffect, useRef, useState } from "react"; | ||
import styled from "styled-components"; | ||
|
||
type Props = React.HTMLAttributes<HTMLDivElement> & { | ||
max: Number; | ||
levelName: string; | ||
sponsors: Array<{ name: string; image: string }>; | ||
}; | ||
|
||
function SponsorTable({ max, levelName, sponsors, ...rest }: Props) { | ||
return ( | ||
<SponsorCard> | ||
<h3>{levelName}</h3> | ||
<div style={{ gridTemplateColumns: `repeat(${max}, 1fr)` }}> | ||
{sponsors.map((sponsor) => ( | ||
<img src={sponsor.image} alt={sponsor.name} /> | ||
))} | ||
</div> | ||
</SponsorCard> | ||
); | ||
} | ||
|
||
const SponsorCard = styled.div` | ||
border: 1px solid #b0a8fe; | ||
border-radius: 16px; | ||
display: flex; | ||
padding: 1rem 1.5rem; | ||
align-items: center; | ||
& > h3 { | ||
color: #b0a8fe; | ||
margin: 0; | ||
flex: 200px; | ||
} | ||
& > div { | ||
width: 100%; | ||
display: grid; | ||
grid-gap: 1.5rem; | ||
flex: auto; | ||
} | ||
@media only screen and (max-width: 810px) { | ||
display: block; | ||
margin: 1rem; | ||
& > div { | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
} | ||
`; | ||
|
||
export default SponsorTable; |
Oops, something went wrong.