generated from HackYourFuture-CPH/boilerplate-for-fp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from HackYourFuture-CPH/feature/homepage
Feature/homepage
- Loading branch information
Showing
44 changed files
with
22,940 additions
and
6,678 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,17 +1,31 @@ | ||
module.exports = { | ||
stories: [ | ||
'../src/**/*.stories.mdx', | ||
'../src/components/*.stories.@(js|jsx|ts|tsx)', | ||
'../src/**/*.stories.@(js|jsx|ts|tsx)', | ||
], | ||
import { join, dirname } from 'path'; | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} | ||
|
||
/** @type { import('@storybook/react-webpack5').StorybookConfig } */ | ||
const config = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
'@storybook/preset-create-react-app', | ||
getAbsolutePath('@storybook/preset-create-react-app'), | ||
getAbsolutePath('@storybook/addon-onboarding'), | ||
getAbsolutePath('@storybook/addon-links'), | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@chromatic-com/storybook'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
], | ||
framework: '@storybook/react', | ||
core: { | ||
builder: '@storybook/builder-webpack5', | ||
framework: { | ||
name: getAbsolutePath('@storybook/react-webpack5'), | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
staticDirs: ['../public'], | ||
}; | ||
export default config; |
This file contains 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
This file contains 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,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
This file contains 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
This file contains 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,20 @@ | ||
.header-container { | ||
display: inline-block; | ||
margin-top: 50px; | ||
} | ||
|
||
.my-button { | ||
background: linear-gradient( | ||
to right, | ||
transparent, | ||
red, | ||
orange, | ||
yellow, | ||
green, | ||
violet | ||
); | ||
border-radius: 7px; | ||
padding: 7px 20px; | ||
font-size: 10px; | ||
font-family: 'Roboto', sans-serif; | ||
} |
This file contains 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,79 @@ | ||
import React, { useState } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { apiURL } from '../../apiURL'; | ||
import './IndexPage.css'; | ||
|
||
function Index() { | ||
const [inputValue, setInputValue] = useState(''); | ||
const [errorMessage, setErrorMessage] = useState(''); | ||
const navigate = useNavigate(); | ||
|
||
const handleInputChange = (e) => { | ||
setInputValue(e.target.value); | ||
// Clear error message when user starts typing again | ||
setErrorMessage(''); | ||
}; | ||
|
||
const handleSubmit = async (e) => { | ||
e.preventDefault(); | ||
|
||
if (inputValue === 'TeamCode') { | ||
try { | ||
const response = await fetch(`${apiURL}/CreateNewTeam/${inputValue}`); | ||
if (response.ok) { | ||
// Navigate to retroPage | ||
navigate('/retroPage'); | ||
} else { | ||
// Set error message for invalid code | ||
setErrorMessage('Invalid code. Please try again.'); | ||
} | ||
} catch (error) { | ||
// Handle fetch error | ||
// console.error('Error:', error); | ||
// Set error message for fetch failure | ||
setErrorMessage('Failed to validate code. Please try again.'); | ||
} | ||
} else { | ||
// Set error message for missing code | ||
setErrorMessage('Please provide a team code.'); | ||
} | ||
}; | ||
|
||
const handleCreateNewTeamClick = () => { | ||
navigate('/CreateNewTeamPage'); | ||
}; | ||
|
||
return ( | ||
<div className="index-container"> | ||
<div className="header-container"> | ||
<h2>Join with</h2> | ||
<form onSubmit={handleSubmit}> | ||
<input | ||
type="text" | ||
placeholder="Team Code" | ||
value={inputValue} | ||
onChange={handleInputChange} | ||
/> | ||
<button type="submit" className="my-button"> | ||
Submit | ||
</button> | ||
</form> | ||
{errorMessage && <p className="error-message">{errorMessage}</p>} | ||
</div> | ||
<h3> OR </h3> | ||
<button | ||
type="button" | ||
onClick={handleCreateNewTeamClick} | ||
className="my-button" | ||
> | ||
Create New Team | ||
</button> | ||
<footer> | ||
<p>Created by RetroRealm</p> | ||
<p>© 2024 RetroRealm. All rights reserved.</p> | ||
</footer> | ||
</div> | ||
); | ||
} | ||
|
||
export default Index; |
This file contains 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,22 @@ | ||
.nav-container { | ||
background: linear-gradient( | ||
to right, | ||
transparent, | ||
red, | ||
orange, | ||
yellow, | ||
green, | ||
blue, | ||
indigo, | ||
violet | ||
); | ||
height: 60px; | ||
} | ||
|
||
.nav-header { | ||
display: flex; | ||
justify-content: flex-end; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} |
This file contains 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,11 @@ | ||
import React from 'react'; | ||
import './Navbar.css'; | ||
|
||
export const Navbar = () => { | ||
return ( | ||
<nav className="nav-container"> | ||
<div className="logo">{/* Add your logo here */}</div> | ||
<h1 className="nav-header">RetroRealm</h1> | ||
</nav> | ||
); | ||
}; |
Oops, something went wrong.