This repository was archived by the owner on Sep 30, 2025. It is now read-only.
forked from HackYourFuture/React
-
Notifications
You must be signed in to change notification settings - Fork 30
Revamped React 1 #68
Open
chezzoba
wants to merge
35
commits into
HackYourFuture-CPH:main
Choose a base branch
from
chezzoba:react1-revamp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Revamped React 1 #68
Changes from 29 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
337adeb
lesson plan week 1
chezzoba b53a9e3
lesson week 2
chezzoba 8e04f7f
created lesson plans
chezzoba f2189cc
Updated preparation
chezzoba a5cc19f
revisions to plans
chezzoba 4ef119c
jsx
chezzoba d32186f
Update lesson-plan-p1.md
bhas 487ea10
fix formatting
bhas c0baf23
exercises and readmes done
chezzoba d5b97c3
Merge branch 'react1-revamp' of https://github.com/chezzoba/React int…
chezzoba 16dfcce
exercises + readmes and merged
chezzoba 476410c
add all files for react 1 HW
ddobby94 64a126b
Merge pull request #1 from chezzoba/ddobby/add-HW-for-react1
ddobby94 896ab5c
delete custom local settings file
ddobby94 f64b471
remove API_KEY + add explanation comment
ddobby94 100fc15
improve main readme
bhas 15d1d4c
revised hw
chezzoba 9d16c98
merged
chezzoba ef1edd9
more merges
chezzoba fe39d21
update week 1 lesson plan
bhas 77271ef
Update readme.md
bhas b373e49
Update readme.md
bhas 153bad4
fix lesson plan for week 1
bhas 25a259d
Update lesson-plan.md
bhas 6f79ae1
improve exercises
bhas f2e0a6a
remove classnames from package.json, convert the 1 instance to pure css
ddobby94 2384a36
update README
ddobby94 00d4844
changed hw
chezzoba 5101dbb
merged
chezzoba 8841faf
addressed comments
chezzoba b8c4a5b
updated initial lesson plan
chezzoba 0bac743
fix week 2 preparation and lesson plan
bhas de593e8
update week 3
bhas 763ecd5
test markdown
bhas f39b33e
update exercises
bhas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Generating an API_KEY | ||
|
||
You need to generate an API Key at NASA's website! | ||
|
||
>> Link to the NASA API: https://api.nasa.gov/ | ||
|
||
After subscribing, you will receive an email with your API_KEY | ||
Overwrite the `API_KEY` variable with your `API_KEY` from the email. It should look like this: | ||
``` | ||
const API_KEY = 'hlcFvEJEPXDr9eUJ7fMHpbsX.....h9V'; | ||
``` | ||
|
||
If you did it successfully, the rover photo should load after reload | ||
|
||
## TIPS: | ||
|
||
There is a limit per user for this API. You can fetch an API 30 times/hour or 50 times/ day. If you get a `429` error message in the console it is because of this. | ||
|
||
You can use another email to get a new `API_KEY` or use the "../../data/mock_data.json" to import the data, but fetch doesn't work with a `.json` file | ||
|
||
The `.json` file represents the data only. So it can be used to display the components, but not for the fetch. | ||
|
||
### How to use the JSON file: | ||
|
||
https://docs.deno.com/examples/importing-json/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"use client" | ||
import { usePathname } from 'next/navigation'; | ||
import Link from 'next/link' | ||
|
||
import styles from './Navbar.module.css'; | ||
|
||
const navbarItems = [ | ||
{ | ||
title: 'ABOUT US', | ||
link: '/about_us', | ||
}, | ||
{ | ||
title: 'DESTINATION', | ||
link: '/destination', | ||
}, | ||
{ | ||
title: 'NASA COLLABORATION', | ||
link: '/nasa_collaboration', | ||
} | ||
]; | ||
|
||
export const Navbar = () => { | ||
const currentPath = usePathname(); | ||
|
||
const isLinkActive = (link) => { | ||
return link === currentPath ? 'active' : undefined; | ||
}; | ||
|
||
return ( | ||
<header className={styles.headerContainer}> | ||
<div className={styles.navbarLogo}> | ||
<a href="/"><img src="/shared/logo.svg" alt="" /> GALACTICA</a> | ||
</div> | ||
<div className={styles.decorativeLine} /> | ||
<nav className={styles.navbar}> | ||
<div className={styles.navbarBG} /> | ||
<ul className={styles.navbarList}> | ||
{/* TASK - React 1 week 2 */} | ||
{/* Create a <NavItem> component, which accepts the following: */} | ||
{/* title, link, isActive */} | ||
<li is-active={isLinkActive(navbarItems[0].link)} className={styles.navbarLinks}> | ||
<Link href={navbarItems[0].link}><b>01</b> {navbarItems[0].title}</Link> | ||
</li> | ||
<li is-active={isLinkActive(navbarItems[1].link)} className={styles.navbarLinks}> | ||
<Link href={navbarItems[1].link}><b>02</b> {navbarItems[1].title}</Link> | ||
</li> | ||
<li is-active={isLinkActive(navbarItems[2].link)} className={styles.navbarLinks}> | ||
<Link href={navbarItems[2].link}><b>03</b> NASA COLLABORATION</Link> | ||
</li> | ||
{/* TASK - React 1 week 3 */} | ||
{/* replace repeating content by using navbarItems.map(() => <NavLink />) */} | ||
</ul> | ||
</nav> | ||
</header> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
.headerContainer { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
padding: var(--spacing-16) var(--spacing-40); | ||
height: var(--header-height); | ||
max-height: var(--header-height); | ||
align-items: center; | ||
z-index: 10; | ||
} | ||
|
||
.decorativeLine { | ||
height: 0.1px; | ||
width: 30vw; | ||
background-color: #999; | ||
margin-inline-end: -60px; | ||
z-index: 10; | ||
} | ||
|
||
.navbarLogo { | ||
margin-inline-end: var(--spacing-20); | ||
} | ||
|
||
.navbarLogo img { | ||
height: 40px; | ||
} | ||
|
||
.navbarLogo a { | ||
display: flex; | ||
align-items: center; | ||
gap: var(--spacing-20); | ||
font-size: large; | ||
font-weight: 600; | ||
color: #fff; | ||
} | ||
|
||
.navbar { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 0 var(--spacing-8); | ||
margin: var(--spacing-20); | ||
background-color: transparent; | ||
|
||
} | ||
|
||
.navbarBG { | ||
position: absolute; | ||
width: 100%; | ||
height: 60%; | ||
backdrop-filter: blur(20px); | ||
} | ||
|
||
.navbarList { | ||
position: relative; | ||
list-style-type: none; | ||
display: flex; | ||
padding: 0 var(--spacing-40); | ||
gap: var(--spacing-20); | ||
z-index: 10; | ||
} | ||
|
||
.navbarLinks a { | ||
color: white; | ||
text-decoration: none; | ||
font-weight: 200; | ||
letter-spacing: 1px; | ||
} | ||
|
||
.navbarLinks:hover, .navbarLinks[is-active] { | ||
border-block-end: var(--spacing-04) solid var(--border-color); | ||
margin-block-end: -4px; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "space-turism", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start" | ||
}, | ||
"dependencies": { | ||
"@chakra-ui/next-js": "^2.2.0", | ||
"@chakra-ui/react": "^2.8.2", | ||
"@emotion/react": "^11.13.0", | ||
"@emotion/styled": "^11.13.0", | ||
"framer-motion": "^11.3.28", | ||
"next": "14.2.5", | ||
"react": "^18", | ||
"react-dom": "^18" | ||
}, | ||
"devDependencies": {} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,2 @@ | ||
# Homework | ||
|
||
## Start the homework | ||
|
||
Need to brush up on the homework setup process? Check [this](https://github.com/HackYourFuture-CPH/Git/blob/main/homework_hand_in.md) out before you get into some git confusion! | ||
|
||
## Todo list | ||
|
||
Using `create-react-app` create a new react project. | ||
|
||
## basic React & props | ||
|
||
Render a basic static todo list with three items: | ||
|
||
``` | ||
Todo List | ||
|
||
* Get out of bed, Wed Sep 13 2017 | ||
* Brush teeth, Thu Sep 14 2017 | ||
* Eat breakfast, Fri Sep 15 2017 | ||
``` | ||
|
||
For each item render a description and a deadline date. Before you start draw a mockup and identify the components with colours. You have to use more than two components. Think which props the components should take. | ||
|
||
## thinking in React | ||
|
||
go through this article https://www.codestackr.com/blog/5-steps-to-think-in-react/ for learning how to think the react way (hooks updated). | ||
|
||
<br/> | ||
|
||
## Hand in homework | ||
|
||
Need to brush up on the homework hand-in process?<br/> | ||
Check [this resource](https://github.com/HackYourFuture-CPH/Git/blob/main/homework_hand_in.md) to remember how to hand in the homework correctly! | ||
Solve the week one tasks in the [homework project](/react1/homework/app/about_us/README.md) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.