sidebar_position |
---|
4 |
import { Fragment } from 'react'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
export const Palette = ({children, color}) => ( <Fragment style={{ display: 'flex' }}> <span style={{ display: 'inline-block', width: '1.6rem', height: '1.6rem', backgroundColor: color, borderRadius: '0.5rem', border: '1px solid black' }}/><p style={{ color: 'black', fontWeight: 'bold', paddingLeft: '0.5rem' }}>{children}
)The Telescope frontend is currently being developed using Typescript and NextJS. We encourage all new developers to read the NextJS docs in order to familiarize themselves with how Next works as well as the Typescript docs in order to understand how the language operates.
When working on a new component for the Telescope frontend, please consider the following:
- We do not use
React.FC
andReact.FunctionalComponent
when making our components. The reason for this can be found here. - We require all components being created to strictly be exported directly inside the components folder. This is due to the way NextJS serves page requests, where we build our pages in the
pages
folder using the components made in thecomponents
folder.
- This link provides some examples that utilize Typescript with common React activities such as creating components and utilizing React Hooks.
- This link provides examples on how to utilize Material-UI with Typescript. This will be helpful for those contributing to the styling and theming of Telescope
- This link provides an example NextJS project, useful to see how a NextJS project works
- This link provides example cases all utilizing NextJS. Useful for understanding a specific case related to the issue you're currently working on.
Here is the colour palette that we use to make our web site looks pretty and up-to-date.
Primary
- hex: #121D59
- rgb: (18,29,89)
Secondary
- hex: #A0D1FB
- rgb: (160,209,251)
Background
- hex: #FFFFFF
- rgb: (255,255,255)
Primary
- hex: #A0D1FB
- rgb: (160,209,251)
Secondary
- hex: #121D59
- rgb: (18,29,89)
Primary
- hex: #A0D1FB
- rgb: (160,209,251)
Secondary
- hex: #4F96D8
- rgb: (79,150,216)
Background
- hex: #000000
- rgb: (0,0,0)
Primary
- hex: #FFFFFF
- rgb: (255,255,255)
Secondary
- hex: #A0D1FB
- rgb: (160,209,251)
Here is how we construct our Theme with MUI (frontend/src/web/app/src/theme/index.ts)
export const lightTheme: Theme = createMuiTheme({
palette: {
type: 'light',
primary: {
main: '#121D59',
},
secondary: {
main: '#A0D1FB',
},
error: {
main: red.A400,
},
background: {
default: '#E5E5E5',
},
text: {
primary: '#000000',
secondary: '#121D59',
},
},
});
primary.main
is used mainly for background color of any container that used the primary colorsecondary.main
is used for the background colour of scroll down and scroll to top buttons.error.main
is used for displaying error messagesbackground.default
is used for the main background of the app as well as the content background of posts.text.primary
is used for the text color of posts' contentstext.secondary
is used for the title of posts and header's icons