Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
73 changes: 73 additions & 0 deletions components/AboutUsPreview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import React from 'react'
import styled, { useTheme, keyframes, FontType, css } from 'styled-components'
import { fontTypeCss } from '@/styles/sample-rhdevs-website/index.styled'

const fadeIn = keyframes`
0% {
opacity: 0;
}
100% {
opacity: 1;
}
`
Comment on lines +5 to +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!


const PreviewText = styled.div<{ hasAnimation?: boolean; fontType: FontType }>`
${fontTypeCss}
margin-top: 20px;
color: ${(props) => props.theme.palette.common.gray};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text hard to see tho... follow the figma

${(props) =>
props.hasAnimation &&
css`
animation-name: ${fadeIn};
animation-delay: 1s;
animation-duration: 1.5s;
animation-fill-mode: both;
`}
`

const PreviewTitle = styled.label<{ fontType: FontType }>`
${fontTypeCss}
color: ${(props) => props.theme.palette.common.black};
background-color: ${(props) => props.theme.palette.common.white};
transition: background-image 0.4s ease-in-out;
width: fit-content;
&:hover {
text-decoration: underline;
}
`

const PreviewWrapper = styled.div`
display: flex;
flex-direction: column;
background-color: ${(props) => props.theme.palette.common.white};
cursor: default;
flex: 1 1 100%;
margin: 0 0 3% 0;
`

type Props = {
title: string
text: string
hasAnimation?: boolean
onClick?: React.MouseEventHandler<HTMLDivElement>
}

const defaultProps = {
hasAnimation: false,
onClick: undefined,
}

export default function Preview(props: Props) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the component to something useful e.g. InformationComponent
Change the name of this file accordingly also, should match the name of the default component export

const theme = useTheme()
const { h4, previewTitle } = { ...theme.typography.fontSize }
return (
<PreviewWrapper onClick={props.onClick}>
<PreviewTitle fontType={previewTitle}>{props.title}</PreviewTitle>
<PreviewText fontType={h4} hasAnimation={props.hasAnimation}>
{props.text}
</PreviewText>
</PreviewWrapper>
)
}

Preview.defaultProps = defaultProps
30 changes: 30 additions & 0 deletions components/FollowUs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import styled from 'styled-components'

const FollowUsContainer = styled.div`
display: flex;
justify-content: flex-end;
align-items: center;
margin: 5px 100px 20px 100px;
`
const Icon = styled.div`
background-color: ${(props) => props.theme.palette.common.gray};
border-radius: 50%;
margin-left: 20px;
width: 50px;
height: 50px;
`

const StyledText = styled.text`
color: ${(props) => props.theme.palette.common.black};
`

export default function FollowUs() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to like SocialMediaLinks or smthg

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use arrow notation for functions!

Suggested change
export default function FollowUs() {
export FollowUs = () => {

return (
<FollowUsContainer>
<StyledText>Follow Us</StyledText>
<Icon></Icon>
<Icon></Icon>
<Icon></Icon>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good for now

</FollowUsContainer>
)
}
2 changes: 1 addition & 1 deletion components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function NavBar() {
key={index}
text={item}
isActive={item.toLowerCase() === pageName || (item === 'Home' && pageName === '')}
href={item === 'Home' ? '/' : `/${item.toLowerCase()}`}
href={item === 'Home' ? '/' : `/${item.toLowerCase().replace(/ /g, '')}`}
/>
))}
</NavItemContainer>
Expand Down
5 changes: 1 addition & 4 deletions components/sample-rhdevs-website/PageSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Image, { StaticImageData } from 'next/image'
import styled, { keyframes, FontType, useTheme } from 'styled-components'
import { fontTypeCss } from '@/styles/sample-rhdevs-website/index.styled'

import imgPlaceholder from '/assets/sample-rhdevs-website/noimg.png'
import imgPlaceholder from '@/assets/sample-rhdevs-website/noimg.png'

const fadeInUp = keyframes`
from {
Expand All @@ -28,11 +28,9 @@ export const MainContainer = styled.div<{
grid-template-columns: ${(props) => props.imgPosition && 'auto'} auto;
grid-template-areas: '${(props) => props.imgPosition === 'left' && 'image'} text ${(props) =>
props.imgPosition === 'right' && 'image'}';

@media screen and (min-width: 700px) {
gap: 5rem;
}

@media screen and (max-width: 700px) {
display: flex;
flex-direction: ${(props) => (props.responsiveReverse ? 'column-reverse' : 'column')};
Expand All @@ -48,7 +46,6 @@ export const ImageContainer = styled(Image)`
max-height: 350px;
max-width: 350px;
grid-area: image;

@media screen and (max-width: 700px) {
margin: 0 0 40px 0;
width: 80%;
Expand Down
6 changes: 3 additions & 3 deletions components/sample-rhdevs-website/ProjectPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const PreviewText = styled.div<{ hasAnimation?: boolean; fontType: FontType }>`

const PreviewTitle = styled.label<{ fontType: FontType }>`
${fontTypeCss}
color: ${(props) => props.theme.palette.common.white};
background-color: ${(props) => props.theme.palette.common.black};
color: ${(props) => props.theme.palette.common.black};
background-color: ${(props) => props.theme.palette.common.white};
transition: background-image 0.4s ease-in-out;
width: fit-content;
&:hover {
Expand All @@ -39,7 +39,7 @@ const PreviewTitle = styled.label<{ fontType: FontType }>`
const PreviewWrapper = styled.div`
display: flex;
flex-direction: column;
background-color: ${(props) => props.theme.palette.common.black};
background-color: ${(props) => props.theme.palette.common.white};
cursor: default;
flex: 1 1 100%;
margin: 0 0 3% 0;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "next build",
"start": " next build && npm run open-browser && next start",
"lint": "next lint",
"open-browser": "start http://localhost:3000"
"open-browser": "open http://localhost:3000"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove, and update your branch from main!

},
"dependencies": {
"@next/font": "13.1.6",
Expand Down
136 changes: 136 additions & 0 deletions pages/aboutus.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/**
* # Create About Us Page
*
* Path: `/aboutus`
*
* ## Page Description
* This page is accessed after the user has clicked on the About Us button on the navigation bar.
*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for now, but when the page is filled do describe more on what the page shows (e.g. shows a brief intro to hall etc.)

*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! However docs should be placed just above the main export function, not at the top of the file


import Image from 'next/image'
import styled from 'styled-components'

import Preview from '@/components/AboutUsPreview'
import FollowUs from '@/components/FollowUs'
import {
facilityBooking,
supperCollation,
announcementBot,
} from '@/texts/sample-rhdevs-website/descriptions/projects'
import { MainContainer } from '@/styles/sample-rhdevs-website/GlobalStyledComponents'

import logoBackground from '@/assets/sample-rhdevs-website/logo_background.png'
import logo from '@/assets/sample-rhdevs-website/RHDevs_Logo2.png'

const AboutUsMainContainer = styled(MainContainer)`
display: grid;
grid-template-rows: 1fr max-content;
grid-template-columns: 1fr;
`

const ImageContainer = styled.div`
background-color: ${(props) => props.theme.palette.common.gray};
background-repeat: no-repeat;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
position: relative;
`

const ImageMask = styled.div`
mask-image: linear-gradient(black 40%, transparent);
text-align: center;
`

const StyledImage = styled(Image)`
height: 20%;
width: 15%;
`
const Arrow = styled.div<{ isRight: boolean }>`
border: solid ${(props) => props.theme.palette.common.white};
border-width: 0 3px 3px 0;
display: inline-block;
padding: 3px;
transform: rotate(${(props) => (props.isRight ? -45 : 135)}deg);
-webkit-transform: rotate(${(props) => (props.isRight ? -45 : 135)}deg);
position: absolute;
left: ${(props) => (props.isRight ? 'auto' : 16)}px;
right: ${(props) => (props.isRight ? 16 : 'auto')}px;
`

const PageDotsContainer = styled.div`
position: absolute;
bottom: 16px;
display: flex;
`
const PageDots = styled.div`
background-color: ${(props) => props.theme.palette.common.white};
border-radius: 50%;
width: 10px;
height: 10px;
margin-left: 5px;
`
const DividerContainer = styled.div`
display: flex;
justify-content: center;
margin-left: 40px;
margin-right: 40px;
`

const Divider = styled.hr`
width: 60%;
border: 1.4px solid ${(props) => props.theme.palette.common.gray};
`

const PreviewContainer = styled.div`
display: flex;
flex-direction: row;
justify-content: space-evenly;
gap: 50px;
margin: 120px 100px 100px 120px;
`

function Projects() {
return (
<AboutUsMainContainer>
<ImageContainer>
<Arrow isRight={false}></Arrow>
<Arrow isRight={true}></Arrow>

<PageDotsContainer>
<PageDots></PageDots>
<PageDots></PageDots>
</PageDotsContainer>
</ImageContainer>

<PreviewContainer>
<Preview
title={facilityBooking.projectTitle}
text={facilityBooking.projectDescription}
hasAnimation
/>
<DividerContainer>
<Divider />
</DividerContainer>
<Preview
title={supperCollation.projectTitle}
text={supperCollation.projectDescription}
hasAnimation
/>
<DividerContainer>
<Divider />
</DividerContainer>
<Preview
title={announcementBot.projectTitle}
text={announcementBot.projectDescription}
hasAnimation
/>
</PreviewContainer>
<FollowUs></FollowUs>
</AboutUsMainContainer>
)
}

export default Projects
2 changes: 1 addition & 1 deletion texts/common/navTitles.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const navTitles = ['Home', 'Events', 'Yearbook']
export const navTitles = ['Home', 'About Us', 'Events', 'Yearbook']