Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/nwplus/admin into erping/ui-…
Browse files Browse the repository at this point in the history
…updates
  • Loading branch information
ErpingS committed Sep 26, 2024
2 parents b9720d5 + 859263c commit ab7bce3
Show file tree
Hide file tree
Showing 7 changed files with 18,819 additions and 357 deletions.
21 changes: 21 additions & 0 deletions components/TextArea.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from 'styled-components'
import { COLOR } from '../constants'

export const TextArea = styled.textarea`
${props =>
props.inline ? 'flex-grow: 1; width: 50%; border-radius: 2px 0 0 2px;' : 'width: 100%; border-radius: 2px;'}
height: 40px;
border: 1px solid ${COLOR.DARK_GRAY};
box-sizing: border-box;
margin-bottom: 0.75rem;
padding: 0 0.75rem;
background: ${COLOR.WHITE};
font-family: inherit;
resize: vertical;
overflow-y: auto;
padding: 0.5rem; /* Padding inside the textarea */
font-size: 16px;
`

export default TextArea
10 changes: 7 additions & 3 deletions components/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Button from './button'
import Dropdown from './dropdown'
import { InputField } from './input'
import TextBox from './textbox'
import { TextArea } from './TextArea'

const BackDropScreen = styled.div`
width: 100vw;
Expand Down Expand Up @@ -52,9 +53,12 @@ export const ModalField = ({ dropdown, dropdownOptions, label, value, type = 'te
{(label === 'Answer' || label === 'Description') && modalAction !== VIEW && (
<TextBox width="95%" defaultValue={value} onChange={onChange} />
)}
{label !== 'Answer' && label !== 'Description' && !dropdown && modalAction !== VIEW && (
<InputField type={type} defaultValue={value} onChange={onChange} />
)}
{label !== 'Answer' &&
label !== 'Description' &&
label !== 'Sponsor Blurb' &&
!dropdown &&
modalAction !== VIEW && <InputField type={type} defaultValue={value} onChange={onChange} />}
{label === 'Sponsor Blurb' && <TextArea type={type} defaultValue={value} onChange={onChange} />}
{dropdown && modalAction !== VIEW && (
<Dropdown options={dropdownOptions} onChange={onChange} defaultValue={value} />
)}
Expand Down
56 changes: 27 additions & 29 deletions components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,16 @@ export default ({ hackathons, currentPath }) => {
setShowSidebar(!showSidebar)
}

// Separate "www" from hackathons
const hackathonList = hackathons.filter(id => id !== 'www')
return (
<>
<SidebarContainer showSidebar={showSidebar}>
<HeaderContainer>
<Header>nwPlus CMS</Header>
{loading && <LoadingImage src={LoadingGif} />}
</HeaderContainer>

<NextLink href="/Livesite/announcements" as="/Livesite/announcements" passHref>
<Link>
<ItemContainer>
Expand All @@ -165,6 +168,7 @@ export default ({ hackathons, currentPath }) => {
</ItemContainer>
</Link>
</NextLink>

<NextLink href="/faq" as="/faq" passHref>
<Link
onClick={() => {
Expand All @@ -183,37 +187,31 @@ export default ({ hackathons, currentPath }) => {
</ItemContainer>
</Link>
</NextLink>

<NextLink href="/www/intro" as="/www/intro" passHref>
<Link
onClick={() => {
if (currentPath !== 'www') {
setIfTimeOut(
setTimeout(() => {
setLoading(true)
}, 750)
)
}
}}
>
<ItemContainer>
<Icon color={currentPath === 'www' && COLOR.WHITE} icon="question-circle" />
<Label selected={currentPath === 'www'}>www</Label>
</ItemContainer>
</Link>
</NextLink>

<ItemContainer>
<Icon color={currentPath && currentPath.includes('hackerapps') && COLOR.WHITE} icon="file-alt" />
<Label selected={currentPath && currentPath.includes('hackerapps')}>Hacker Apps</Label>
</ItemContainer>
{HACKATHONS.map(id => {
const href = '/hackerapps/[id]/welcome'
const link = `/hackerapps/${id}/welcome`
return (
<NextLink key={id} href={href} as={link} passHref>
<IndentedLink
onClick={() => {
if (currentPath !== `hackerapps/${id}`) {
setIfTimeOut(
setTimeout(() => {
setLoading(true)
}, 750)
)
}
}}
selected={currentPath === `hackerapps/${id}`}
>
{id}
</IndentedLink>
</NextLink>
)
})}
<ItemContainer>
<Icon color={hackathons.includes(currentPath) && COLOR.WHITE} icon="th-list" />
<Label selected={hackathons.includes(currentPath)}>Websites</Label>
<Icon icon="th-list" />
<Label>Hackathons</Label>
</ItemContainer>
{hackathons.map(id => {
{hackathonList.map(id => {
const href = generateLinkTemplate(id)
const link = generateLink(id)
return (
Expand Down
1 change: 1 addition & 0 deletions components/spocos.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const Text = styled.p`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 175px;
color: ${COLOR.BODY_TEXT};
`

Expand Down
Loading

0 comments on commit ab7bce3

Please sign in to comment.