Skip to content

Feedback #1

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

Open
wants to merge 2 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file removed .github/.keep
Empty file.
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,107 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
Expand Down
71 changes: 1 addition & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
# react-starter
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-dashboard",
"name": "react-starter",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand All @@ -9,10 +9,12 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"sass": "^1.53.0",
"styled-components": "^5.3.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"start": "BROWSER=none react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down
6 changes: 4 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>React Dashboard</title>
<meta name="theme-color" content="#000000" />
<title>React Starter</title>
</head>

<body>

<div id="root"></div>

</body>

</html>
14 changes: 14 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.app {
margin: 0;
padding: 0;

display: flex;
flex-direction: column;
align-items: stretch;
justify-content: flex-start;

width: 100%;
min-height: 80vh;

background-color: whitesmoke;
}
57 changes: 56 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,61 @@
import { useState } from "react";

import Header from "./components/Header/Header";
import Lessons from "./components/Lessons/Lessons";
import FilterSelect from "./components/Filter/FilterSelect";
import Register from "./components/Register/Register";

import "./App.css";

const App = () => {

const DATA = [{
id: 1,
name: "Kodluyoruz Istanbul React Bootcamp",
limit: 10,
date: new Date()
},
{
id: 2,
name: "Kodluyoruz Bursa Vue Bootcamp",
limit: 0,
date: new Date()
},
{
id: 3,
name: "Kodluyoruz Mersin Angular Bootcamp",
limit: 5,
date: new Date()
},
{
id: 4,
name: "Kodluyoruz Antalya Front-End Bootcamp",
limit: 5,
date: new Date()
}];

const [filteredLessons, setFilteredLessons] = useState(DATA);

const formSubmitHandler = (name, email) => {
console.log(name, email)
}

const filterLessons = (selected) => {
if (selected == "") {
return setFilteredLessons(DATA);
}

const filtered = DATA.filter(lessons => lessons.name.includes(selected));
setFilteredLessons(filtered);
}

return (
<h1>React Dashboard</h1>
<section className="app">
<Register onFormSubmit={formSubmitHandler} />
<Header></Header>
<FilterSelect onFilterCities={filterLessons} />
<Lessons data={filteredLessons}></Lessons>
</section>
);
}

Expand Down
14 changes: 14 additions & 0 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// import "./Button.css";
import style from "./Button.module.css";

const CTAButton = (props) => {

const classes = style.button + " " + style[props.className]
// const classes = `${style.button} ${style.blue}`

return (
<button className={classes}>{props.text}</button>
)
}

export default CTAButton;
17 changes: 17 additions & 0 deletions src/components/Button/Button.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.button {
display: block;
margin-right: 20px;
padding: 20px 40px;

border: 0;
background-color: rgb(163, 201, 86);
border-radius: 6px;

font-family: Arial;
font-size: 24px;
font-weight: 600;
}

.button.blue {
background-color: rgb(141, 162, 228);
}
15 changes: 15 additions & 0 deletions src/components/Button/ButtonTicket.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import style from "./Button.module.css";

const ButtonTicket = (props) => {

const clickAction = () => {
props.onClickAction();
console.log("clickAction")
}

return (
<button className={style.button} onClick={clickAction}>{props.text}</button>
)
}

export default ButtonTicket
32 changes: 32 additions & 0 deletions src/components/Card/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { useState } from "react";
import ButtonTicket from "../Button/ButtonTicket";
import style from "./Card.module.scss";

const Card = (props) => {

const [limitOfLesson, setLimitOfLesson] = useState(props.limit);
console.log("Card Components");


const reserveHandler = () => {
if (limitOfLesson === "Tukendi") return;
let hasLimit = limitOfLesson - 1;

if (!hasLimit) {
setLimitOfLesson("Tukendi");
return;
}

setLimitOfLesson(hasLimit);
}

return (
<div className={style.card}>
<div className={style.card__name}>{props.name}</div>
<div className={style.card__date}>{props.date.toLocaleDateString("tr", { year: 'numeric', month: "long" })}</div>
<ButtonTicket text={limitOfLesson} onClickAction={reserveHandler} />
</div>
)
}

export default Card;
Loading