Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/branding #78

Merged
merged 30 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8b8265c
create branding page
suejinkim20 Dec 14, 2023
8e7f4d9
add brand, color, and typography sections to branding page
suejinkim20 Dec 14, 2023
8473c70
add block component
suejinkim20 Dec 14, 2023
e0daaa7
use block component in typography section on branding page
suejinkim20 Dec 14, 2023
6f5fa9f
update typography
suejinkim20 Dec 15, 2023
ecf9840
add color block component for branding page
suejinkim20 Dec 15, 2023
88e2298
add color section to branding page
suejinkim20 Dec 15, 2023
7723808
remove ColorTab export
suejinkim20 Dec 15, 2023
fe4da8f
add logos and logo section to branding page
suejinkim20 Dec 15, 2023
4b1a278
remove typography section
suejinkim20 Dec 19, 2023
86e6c91
remove gutterBottom property and add to theme file
suejinkim20 Dec 19, 2023
40fa8c0
add link to branding page in footer
suejinkim20 Jan 4, 2024
0220212
implement Stack on color block component
suejinkim20 Jan 4, 2024
344be5b
add copyToClipboard function
suejinkim20 Jan 4, 2024
da00813
change branding color names
suejinkim20 Jan 11, 2024
7397786
update styles, including on hover and active styles for info block
suejinkim20 Feb 1, 2024
d9244b0
update branding colors
suejinkim20 Feb 1, 2024
1727395
add cursor pointer on hover for copyToClipboard items
suejinkim20 Feb 7, 2024
a4248e3
add dummy getStaticProps
suejinkim20 Feb 7, 2024
43d5579
update styles for logo block and remove image url section
suejinkim20 Feb 7, 2024
d6c8cee
switch link component to html a tag
suejinkim20 Feb 8, 2024
c7c3c74
remove unneded block component
suejinkim20 Feb 15, 2024
e056967
move hexToRgb function into utils
suejinkim20 Feb 15, 2024
7ea5791
remove unneeded props and imports
suejinkim20 Feb 15, 2024
990a43a
switch out the copy icon
suejinkim20 Feb 15, 2024
79c5c50
move copyToClipboard function from hooks folder to utils
suejinkim20 Feb 15, 2024
d3a9dac
change colorRgb to include full rgb syntax
suejinkim20 Feb 15, 2024
1cadc67
make color name copyable too
suejinkim20 Feb 15, 2024
bf4b156
fix inconsistent indentation
suejinkim20 Feb 15, 2024
5adf6cc
consolidate background color under sx prop and remove style prop
suejinkim20 Feb 16, 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
51 changes: 51 additions & 0 deletions components/branding/ColorBlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from 'react'
import { Card, CardContent, Stack } from '@mui/material/'
import { InfoBlock } from './InfoBlock'
import { hexToRgb } from '@/utils/hextoRgb'

const styles = {
card: {
margin: '16px',
display: 'flex',
flexDirection: 'row',
},
colorChip: {
flex: 1,
minWidth: '100px',
minHeight: 'auto',
},
content: {
flex: 3,
display: 'flex',
justifyContent: 'flex-start',
flexDirection: 'row',
flex: 5,
width: '100%',
},
info: {
flex: 1,
flexBasis: '33%',
}
}

export const ColorBlock = ({colorName, colorHex}) => {
const { r, g, b } = hexToRgb(colorHex)
const colorRgb = `rgb(${[r, g, b].join(', ')})`

return (
<Card elevation={3} sx={styles.card}>
<CardContent sx={styles.colorChip} style={{ backgroundColor: colorHex }}/>
<CardContent sx={styles.content}>
<Stack
direction={{ sm: 'column', md: 'row' }}
spacing={{ xs: 1, sm: 2, md: 4 }}
sx={{width: '100%'}}
>
<InfoBlock copyable title="Name" body={ colorName } style={styles.info}/>
<InfoBlock copyable title="Hex" body={ colorHex } style={styles.info}/>
<InfoBlock copyable title="RGB" body={ colorRgb } style={styles.info}/>
suejinkim20 marked this conversation as resolved.
Show resolved Hide resolved
</Stack>
</CardContent>
</Card>
)
}
20 changes: 20 additions & 0 deletions components/branding/ColorSection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import Grid from '@mui/material/Grid'
import { ColorBlock } from './ColorBlock'

export const ColorSection = (props) => {
const { colors } = props
return (
<Grid container >
{
Object.keys(colors).map(function(key) {
return (
<Grid item xs={12} key={ colors[key].name }>
<ColorBlock colorName={ colors[key].name } colorHex={ colors[key].hex } />
</Grid>
)
})
}
</Grid>
)
}
58 changes: 58 additions & 0 deletions components/branding/InfoBlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react';
import { Typography } from '@mui/material'
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
import { copyToClipboard } from '@/utils/copyToClipboard';

const styles = {
title: {
color: '#666676',
},
body: {
color: '#666676',
marginBottom: '8px',

},
copyableBody: {
// color: '#666676',
marginBottom: '1px',
'&:active': {
color: '#474748'
},
'&:hover': {
cursor: 'pointer'
},
'&:hover .copyIcon': {
opacity: 0.7,
},
},
copyIcon: {
textTransform: 'uppercase',
marginLeft: '8px',
opacity: 0,
fontSize: '98%',
},
}

export const InfoBlock = ( props ) => {
const { copyable } = props

return (
<div style={props.style}>
<Typography variant="body1" sx={ styles.title }>
{ props.title }
</Typography>
<Typography variant="body2"
onClick={()=> copyToClipboard(props.body)}
suejinkim20 marked this conversation as resolved.
Show resolved Hide resolved
sx={copyable ? styles.copyableBody : styles.body}>
{ props.body }
{
copyable
? <ContentCopyIcon fontSize="small" sx={styles.copyIcon} className="copyIcon"/>
: null
}
</Typography>

</div>
)
}

43 changes: 43 additions & 0 deletions components/branding/LogoBlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react'
import { Card, CardContent } from '@mui/material/'
import Image from 'next/image'

// to do:
// consider using usePathname and our custom
// Link component when upgrading to Nextjs v13
Copy link
Member

Choose a reason for hiding this comment

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

👍


const styles = {
card: {
padding: 0,
margin: '16px'
},
topper: {
borderBottom: `1px solid grey`,
},
content: {
backgroundColor: 'white',
},
}

export const LogoBlock = ({logo, bgColor}) => {
return (
<Card sx={ styles.card }>
<CardContent sx={{ ...styles.topper, backgroundColor: bgColor }}>
<a
href={logo.src}
target="_blank"
rel="noopener noreferrer"
>
<Image
src={ logo.src }
alt="Logo"
width={logo.width}
height={logo.height}
layout="responsive"
objectFit='cover'
/>
</a>
</CardContent>
</Card>
)
}
30 changes: 30 additions & 0 deletions components/branding/LogoSection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react'
import Grid from '@mui/material/Grid'
import { LogoBlock } from './LogoBlock'

const styles = {
logoGrid: {
marginBottom: '32px',
display: 'flex',
justifyContent: 'flex-start',
width: '100%',
},
logoBlock: {
flexGrow: 1,
width: '100%',
},
}

export const LogoSection = ({logos}) => {
return (
<Grid container sx={ styles.logoGrid }>
{
logos.map( (logo) => {
return <Grid item xs={12} md={ 6 } lg={4} sx={ styles.logoBlock } key={ logo.image }>
Copy link
Member

Choose a reason for hiding this comment

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

👍 this responsiveness is nice

<LogoBlock logo={ logo.image } bgColor={ logo.bgColor }/>
</Grid>
})
}
</Grid>
)
}
5 changes: 5 additions & 0 deletions components/branding/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './ColorSection'
export * from './ColorBlock'
export * from './InfoBlock'
export * from './LogoSection'
export * from './LogoBlock'
1 change: 1 addition & 0 deletions components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './link-tray'
export * from './people'
export * from './pre'
export * from './markdown'
export * from './branding'
1 change: 1 addition & 0 deletions components/layout/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const Footer = () => {
<strong>More</strong>
<ul className="link-list">
<li><Link to="/about">About</Link></li>
<li><Link to="/about/branding">Branding</Link></li>
Copy link
Member

Choose a reason for hiding this comment

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

👍

<li><Link to="/careers">Careers</Link></li>
<li><Link to="https://dashboard.renci.org/">RENCI Dashboard</Link></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion hooks/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './use-scroll-position'
export * from './use-scroll-position'
Binary file added images/branding/clearspace-logo.png
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.
Binary file added images/branding/png/simple/renci-logo-simple.png
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.
Binary file added images/branding/png/standard/renci-logo-alt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/branding/png/standard/renci-logo-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/branding/png/standard/renci-logo-gray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/branding/png/standard/renci-logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/branding/png/standard/renci-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading