Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d0425f9
updated with new assets
LWS49 Sep 16, 2023
cf00edf
Add image carousel
andrechuakj Sep 18, 2023
64d91fe
Add link to event page with stringToSlug function
wr1159 Sep 20, 2023
093f64b
Create dynamic event page with dummy data
wr1159 Sep 20, 2023
91cac09
Remove unused page.tsx
wr1159 Sep 20, 2023
6add315
Add styling for more responsiveness
wr1159 Sep 21, 2023
54e1ab0
Add photo link container
wr1159 Sep 21, 2023
10b5f67
Add background image for description
wr1159 Sep 22, 2023
05cfac1
Add stickers for the description container
wr1159 Sep 22, 2023
faf7aff
Add responsive heading based on device size
wr1159 Sep 22, 2023
5d65a9b
Style view photo link
wr1159 Sep 22, 2023
603d9d9
Use event as title, description, img source
wr1159 Sep 23, 2023
524cf5c
Add BryndanWrite font to event description and fix font-face style
wr1159 Sep 23, 2023
6f938b0
Fix placing of stickers
wr1159 Sep 23, 2023
5ceaa9b
Add remaining 2 stickers and fix positioning
wr1159 Sep 23, 2023
f92c32e
Add font bryndanwrite to title
wr1159 Sep 23, 2023
319b68e
Style event link on events page
wr1159 Sep 23, 2023
06a5bda
ran npm update + replace welcome picture
LWS49 Oct 2, 2023
0ce0f82
Merge pull request #24 from rhdevs/feature/event-page
LWS49 Oct 2, 2023
5f911d9
Merge branch 'design' of https://github.com/rhdevs/rh-superapp into d…
LWS49 Oct 2, 2023
e54fa09
Carousel: Add margin to arrows and coloured background for dots
andrechuakj Oct 2, 2023
0008508
components/PageNavBar.tsx
LWS49 Oct 2, 2023
f5e4a48
updated design for events page
LWS49 Oct 2, 2023
ad6410d
modified size of welcomeText
LWS49 Oct 2, 2023
43b0bce
Merge pull request #23 from andrechuakj/design
LWS49 Oct 2, 2023
93d572d
Merge branch 'design' of https://github.com/rhdevs/rh-superapp into d…
LWS49 Oct 2, 2023
a8545e6
Add responsive design
Cikguseven Oct 20, 2023
39897c4
Update index.tsx
Cikguseven Oct 20, 2023
393b36a
Fix Navbar bug
Cikguseven Oct 24, 2023
f4e7f95
Import calendar package
Cikguseven Nov 6, 2023
190fe78
WIP
Cikguseven Nov 10, 2023
618383b
Add Calendar page
Cikguseven Nov 10, 2023
c9a9df5
Merge pull request #25 from Cikguseven/design
LWS49 Jan 17, 2024
f9cd7ee
merging design changes
LWS49 Jan 17, 2024
833b713
removed old designs
LWS49 Jan 17, 2024
c0eab0a
Add deployment URL to README
wr1159 Mar 2, 2024
225104b
Update dummy data and slugs to use dummy data
wr1159 Mar 2, 2024
487cb0e
Fix build error
wr1159 Mar 2, 2024
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
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"extends": [
"next/core-web-vitals",
"plugin:react/recommended",
"airbnb",
"plugin:security/recommended",
"plugin:import/typescript",
"prettier"
Expand All @@ -25,7 +24,7 @@
"version": "detect"
}
},
"plugins": ["react", "@typescript-eslint", "security", "unused-imports", "prettier"],
"plugins": ["unused-imports", "react", "@typescript-eslint", "security", "prettier"],
"rules": {
"import/extensions": [
"error",
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

Deployed on vercel to [rh-superapp.vercel.app](rh-superapp.vercel.app).

## Getting Started

First, run the development server:
Expand Down
80 changes: 80 additions & 0 deletions components/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import React, { useState, useEffect } from 'react'
import Slider from 'react-styled-carousel'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

super ugly carousel... any random library also nicer

import PropTypes from 'prop-types'
import styled from 'styled-components'
import Image from 'next/image'

const responsive = [
{ breakPoint: 1580, cardsToShow: 5 }, // this will be applied if screen size is greater than 1280px. cardsToShow will become 4.
{ breakPoint: 800, cardsToShow: 4 },
{ breakPoint: 640, cardsToShow: 3 },
]

const DotsWrapper = styled.ul`
display: block;
margin: 0 auto;
list-style: none;
text-align: center;
padding: 0px;
background-color: rgba(0, 0, 0, 0.3);
border-radius: 20px;
width: fit-content;
`

const ImageContainer = styled.div<{ $height?: number }>`
display: flex;
justify-content: center;
align-items: center;
margin: 0 10px;
height: ${(props) => props.$height?.toString() + 'px' || 'auto'};
width: 300px;
position: relative;
`

const Carousel = ({ imgArr }) => {
const [maxImageWidth, setMaxImageWidth] = useState(0)
const [imageHeight, setImageHeight] = useState(0)

const imageStyle = {
padding: '10px',
maxWidth: `${maxImageWidth}px`,
}

useEffect(() => {
const updateImageDimensions = () => {
setMaxImageWidth(window.innerWidth / 4)
setImageHeight(window.innerWidth / 6)
}

updateImageDimensions()

window.addEventListener('resize', updateImageDimensions)

return () => {
window.removeEventListener('resize', updateImageDimensions)
}
}, [])

return (
<Slider
responsive={responsive}
showDots={true}
autoSlide={3000}
margin={'0px 15px'}
DotsWrapper={DotsWrapper}
>
{imgArr &&
imgArr.map((item) => (
<ImageContainer key={item.id} $height={imageHeight}>
<Image src={item.src} layout="fill" objectFit="contain" alt="" style={imageStyle} />
</ImageContainer>
))}
</Slider>
)
}

Carousel.propTypes = {
imgArr: PropTypes.array.isRequired,
}

export default Carousel
6 changes: 2 additions & 4 deletions components/LandingItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ const EventContext = createContext<EventContextInterface>(defaultEventContext)
* @returns <ParallaxBanner> component
*/
export const ParallaxHero = () => (
<ParallaxBanner
layers={[{ image: 'https://picsum.photos/2560/1440', speed: -30 }]}
style={{ aspectRatio: '2 / 1' }}
/>
<ParallaxBanner layers={[{ image: '/assets/sample_photos/photo1.jpg', speed: -30 }]} />
)

/**
Expand Down Expand Up @@ -135,6 +132,7 @@ const EventList = () => {
<EventContainer>
{dummyData.map((item: Event) => (
<EventItem
key={item.id.toString()}
id={item.id.toString()}
onClick={() => {
alert('put modal here pls')
Expand Down
18 changes: 16 additions & 2 deletions components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import styled from 'styled-components'
import Image from 'next/image'

import { navTitles } from '@/texts/common/navTitles'
import NavItem from './NavItem'
Expand All @@ -14,13 +15,11 @@ const MainContainer = styled.div<{ isVisible: boolean }>`
${(props) => props.isVisible && 'position: fixed;'}
top: ${(props) => (props.isVisible ? 0 : `-${NAV_BAR_HEIGHT}`)};
transition: top 0.3s;
background-color: ${(props) => `${props.theme.palette.common.black}`};
`

const NavItemContainer = styled.div`
height: ${NAV_BAR_HEIGHT};
display: flex;
margin-left: 3rem;

a + a {
margin-left: 2rem;
Expand All @@ -31,6 +30,18 @@ const NavBarSpace = styled.div<{ isVisible: boolean }>`
height: ${(props) => (props.isVisible ? NAV_BAR_HEIGHT : '0')};
`

const ImageContainer = styled.div`
height: ${NAV_BAR_HEIGHT};
display: flex;
margin-left: 1rem;
margin-top: 1rem;
margin-right: 2rem;

a + a {
margin-left: 2rem;
}
`

function NavBar() {
const router = useRouter()
const pageFilePath = router.pathname
Expand All @@ -53,6 +64,9 @@ function NavBar() {
<>
<MainContainer isVisible={isVisible}>
<NavItemContainer>
<ImageContainer>
<Image src="/assets/rh-logo.png" width={50} height={50} alt="RH logo" />
</ImageContainer>
{navTitles.map((item, index) => (
<NavItem
key={index}
Expand Down
2 changes: 1 addition & 1 deletion components/NavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const activeCss = css`
`

const inactiveCss = css`
color: ${(props) => props.theme.palette.common.white};
color: ${(props) => props.theme.palette.common.black};
&:hover {
font-size: 130%;
}
Expand Down
54 changes: 54 additions & 0 deletions components/PageNavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Button } from 'antd'
import styled from 'styled-components'

export const NAV_BAR_HEIGHT = '4rem'

const MainContainer = styled.div`
width: 100vw;
height: ${NAV_BAR_HEIGHT};
margin: 10px;
display: flex;
flex-direction: row;
bottom: 10;
justify-content: space-evenly;
`

type Props = {
navigateToNext: () => void
navigateToPrev: () => void
isPrevVisible: boolean
isNextVisible: boolean
}

const PageNavBar = (props: Props) => (
<MainContainer>
{
<Button
style={{ background: '#ab7865' }}
type="primary"
title="Previous"
onClick={() => {
props.navigateToPrev()
}}
disabled={!props.isPrevVisible}
>
Previous
</Button>
}
{
<Button
style={{ background: '#ab7865' }}
type="primary"
title="Next"
onClick={() => {
props.navigateToNext()
}}
disabled={!props.isNextVisible}
>
Next
</Button>
}
</MainContainer>
)

export default PageNavBar
83 changes: 72 additions & 11 deletions components/sample-rhdevs-website/PageSection.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react'
import Image, { StaticImageData } from 'next/image'
import Link from 'next/link'
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 '@/public/assets/noimg.png'
import { stringToSlug } from '@/utils/stringToSlug'

const fadeInUp = keyframes`
from {
Expand All @@ -25,6 +26,7 @@ export const MainContainer = styled.div<{
animation-name: ${fadeInUp};
display: grid;
grid-template-rows: minmax(0, 1fr);
text-align: center;
grid-template-columns: ${(props) => props.imgPosition && 'auto'} auto;
grid-template-areas: '${(props) => props.imgPosition === 'left' && 'image'} text ${(props) =>
props.imgPosition === 'right' && 'image'}';
Expand All @@ -43,7 +45,7 @@ export const MainContainer = styled.div<{
}
`

export const ImageContainer = styled(Image)`
export const ImageContainer = styled.div`
object-fit: contain;
max-height: 350px;
max-width: 350px;
Expand All @@ -63,19 +65,36 @@ export const TextContainer = styled.div`
gap: 1rem;
`

export const Title = styled.h2<{ events?: boolean; fontType: FontType }>`
color: ${(props) => (props.events ? 'white' : props.theme.palette.primary)};
export const Title = styled.h1<{ events?: boolean; fontType: FontType }>`
color: ${(props) => (props.events ? 'Black' : props.theme.palette.primary)};
${fontTypeCss}
margin-block: 0;
&:hover {
color: ${(props) => (props.events ? '#555' : props.theme.palette.secondary)};
}
font-family: 'BryndanWrite';
`

export const Body = styled.p<{ events?: boolean; fontType: FontType }>`
${(props) => `color: ${props.theme.palette.common.gray};`}
${fontTypeCss}
${(props) => `color: ${props.theme.palette.common.black};`}
font-size: 1.1rem;
white-space: pre-wrap;
margin: 0;
text-align: justify;
font-family: 'BryndanWrite';
`

const ViewPhotosContainer = styled.div`
border-radius: 1rem; /* Similar to "rounded-m" in Tailwind CSS */
background-color: #ffffff; /* Add a background color */
padding: 0.2 rem; /* Add padding for spacing */
width: 100%;
margin-top: 20px;
`
const ViewPhotoLink = styled.p`
color: #000000;
font-family: 'BryndanWrite';
break-word: break-all;
`

type Props = {
Expand All @@ -84,6 +103,8 @@ type Props = {
imgPosition?: 'left' | 'right' | undefined
imageSrc?: StaticImageData
events?: boolean
signUpLink?: string | null
photoLink?: string | null
} & typeof defaultProps

const defaultProps: {
Expand All @@ -103,15 +124,55 @@ function PageSectionComponent(props: Props) {
return (
<MainContainer imgPosition={props.imgPosition}>
{props.imgPosition && (
<ImageContainer src={props.imageSrc ?? imgPlaceholder} alt={props.title} />
<ImageContainer>
<Image
src={props.imageSrc?.src ?? imgPlaceholder}
height={300}
width={300}
alt={props.title}
// priority={false}
/>
</ImageContainer>
)}
<TextContainer>
<Title fontType={sectionTitle} events={props.events}>
{props.title}
</Title>
<Link href={'events/' + stringToSlug(props.title)} style={{ textDecoration: 'none' }}>
<Title fontType={sectionTitle} events={props.events}>
{props.title}
</Title>
</Link>

<Body fontType={sectionText} events={props.events}>
{props.description}
</Body>
<ViewPhotosContainer>
<ViewPhotoLink>
{props.photoLink ? (
<ViewPhotosContainer>
<Link
prefetch
passHref
href={props.photoLink || '/404'}
style={{ textDecoration: 'none' }}
>
<ViewPhotoLink>photo link: {props.photoLink}</ViewPhotoLink>
</Link>
</ViewPhotosContainer>
) : props.signUpLink ? (
<ViewPhotosContainer>
<Link
prefetch
passHref
href={props.signUpLink || '/404'}
style={{ textDecoration: 'none' }}
>
<ViewPhotoLink>sign-up link: {props.signUpLink}</ViewPhotoLink>
</Link>
</ViewPhotosContainer>
) : (
'sign-up link: NA'
)}
</ViewPhotoLink>
</ViewPhotosContainer>
</TextContainer>
</MainContainer>
)
Expand Down
Loading