Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
4e5f56e
your commit message
XDRO Nov 2, 2023
2b6d6ec
refactor file structor
XDRO Nov 2, 2023
130bf51
move index outside of index folder
XDRO Nov 2, 2023
72b816c
refactor file structor
XDRO Nov 2, 2023
8229004
start on header
XDRO Nov 2, 2023
59ce34e
find user location
XDRO Nov 2, 2023
62e6ede
remove location.js
XDRO Nov 2, 2023
e5f4d97
find user location
XDRO Nov 2, 2023
d5b7be3
Add Images as well as create Header.js/css
XDRO Nov 3, 2023
0d6d775
refactor import for weatherImages
XDRO Nov 3, 2023
c5359f6
refactor weatherImges into day/night image folder
XDRO Nov 3, 2023
b83bb8b
refactor header
XDRO Nov 3, 2023
dfdd84d
refactor weather cards
XDRO Nov 3, 2023
a1d97d3
create api for weather
XDRO Nov 4, 2023
a8e2d55
create forms
XDRO Nov 4, 2023
a2fd813
uncomment weather api
XDRO Nov 4, 2023
25fbb75
get api for weather running
XDRO Nov 5, 2023
e84474f
handle escape close event
XDRO Nov 6, 2023
410c699
add key item._id
XDRO Nov 6, 2023
5f0e988
get escape key working as well as fix errors
XDRO Nov 6, 2023
57541b3
retrieve location data
XDRO Nov 6, 2023
9a4cdea
retrive location data
XDRO Nov 6, 2023
e3b6165
retrieve location city data
XDRO Nov 6, 2023
710c1e2
rename getWeather to getWeatherAndLocation
XDRO Nov 6, 2023
ffb5c10
replace weather api with api
XDRO Nov 6, 2023
fde3716
get city location and add it to DOM
XDRO Nov 6, 2023
f2a5c48
add css to forms
XDRO Nov 7, 2023
4556b0d
add css styles
XDRO Nov 7, 2023
0b58da1
get overlay close on click to work for modals
XDRO Nov 8, 2023
ef733dc
get modal to close on click
XDRO Nov 8, 2023
bf5535c
get project ready for 1st submit
XDRO Nov 8, 2023
58f7747
remove imports
XDRO Nov 9, 2023
ef61fca
refactor file structure
XDRO Nov 9, 2023
604591d
rename Components to components
XDRO Nov 9, 2023
2bf328a
rename Utils folder to utils update imports
XDRO Nov 9, 2023
0ff89d4
remove commented out lines from header.js
XDRO Nov 9, 2023
54d787d
rename currentDate to CurrentDate
XDRO Nov 9, 2023
7d26a60
remove commented out lines from app.js
XDRO Nov 9, 2023
7026a22
convert date.js into a function in app.js then prop drill currentDate
XDRO Nov 9, 2023
3d1844e
refactor for 2nd submit not ready yet
XDRO Nov 9, 2023
a2ff1f9
move weather options to constants, update src
XDRO Nov 9, 2023
3d36d27
change imageSrc const to weatherOption weatherC.js
XDRO Nov 9, 2023
aed8ef5
change i to item in weatherCard.js
XDRO Nov 9, 2023
3d22d1a
remove extra imports from weatherApi.js
XDRO Nov 9, 2023
3d89e79
Add a functoin for processing server res wApi.js
XDRO Nov 9, 2023
f1e838e
remove res from .then in wApi.js
XDRO Nov 9, 2023
639c35f
change filter to find then change array to object
XDRO Nov 9, 2023
e1335d2
change itemcard to itemCard in github dev
XDRO Nov 9, 2023
f57754a
refactor get weather and location function
XDRO Nov 9, 2023
a115fc1
Merge branch 'main' of https://github.com/XDRO/se_project_react
XDRO Nov 9, 2023
fe19b4f
remove the default value from buttonText
XDRO Nov 9, 2023
000a3b6
remove debugger console.logs
XDRO Nov 9, 2023
ddbac03
create a re-usable function used for errors
XDRO Nov 10, 2023
bd13c95
add screenshots to readme file
XDRO Nov 10, 2023
b57c9e3
create utils.js file move processServerResponse
XDRO Nov 11, 2023
c6ae2a5
get toggleSwitch to change temp for F to C
XDRO Nov 17, 2023
f0b4b94
add temperature change
XDRO Nov 17, 2023
20f9007
push for tutor review
XDRO Nov 20, 2023
44bd5e4
get temp units working
XDRO Nov 20, 2023
987afe9
set up the profile
XDRO Nov 20, 2023
d1c9ab5
make a delete confirmation modal
XDRO Nov 21, 2023
715a4e7
make the delete confirmation modal
XDRO Nov 22, 2023
aee8f77
add api and db.json
XDRO Nov 22, 2023
6b76ffa
update api in main
XDRO Nov 23, 2023
184210d
get items to render using api
XDRO Nov 23, 2023
be2af1b
fix infinite loop of get request /items
XDRO Nov 23, 2023
a552165
fix infinite loop
XDRO Nov 23, 2023
81d4305
push for addItem
XDRO Nov 23, 2023
3305845
update to most recent commit
XDRO Nov 24, 2023
db9a1db
get delete handle event to fire
XDRO Nov 25, 2023
e2f249a
push for update on delete handler
XDRO Nov 25, 2023
f1f8d5a
get ready for first review
XDRO Nov 25, 2023
8e4e8a9
remove empty folder
XDRO Nov 27, 2023
3a91bb4
move contexts to src folder
XDRO Nov 27, 2023
cc4b72b
move addItemModal and toggleSwitch to componenets
XDRO Nov 27, 2023
9f5a395
refactor for review
XDRO Nov 27, 2023
82a26d9
fix error in ClothingSection.js
XDRO Nov 27, 2023
4d9a633
add link to readme.md file
XDRO Nov 27, 2023
8179895
fix profile card click error
XDRO Nov 27, 2023
e059610
fix handle delete
XDRO Nov 28, 2023
b339d51
handle close modal on delete
XDRO Nov 28, 2023
ceb9005
fix unique key error onAddItem with generateUniqueId
XDRO Nov 28, 2023
abdc9d9
refactor add item modal per review
XDRO Nov 28, 2023
b5cd818
change function to async functions in onAddItem modal
XDRO Nov 28, 2023
235cab0
fix error on add item unique key value
XDRO Nov 28, 2023
6bcd3a8
remove extra div tag in header.js
XDRO Nov 28, 2023
d4c02b6
change the button on close to handle submit function .then(handleClos…
XDRO Nov 28, 2023
c41b252
change div inside of sideBar.js file to p tag
XDRO Nov 28, 2023
b00ac88
remove import React from deleteItemModal.js file
XDRO Nov 28, 2023
fd2d7eb
add alt text to image tags
XDRO Nov 28, 2023
ff67930
rename useForm to UseForm
XDRO Nov 28, 2023
b313913
remove {} from return in UseForm.js
XDRO Nov 28, 2023
81ae03a
comment out UseForm.js, says to use jsx
XDRO Nov 28, 2023
7cb8ebf
fix handleCloseMModal on AddItemModal
XDRO Nov 29, 2023
30a4c53
fix issues in app.js
XDRO Nov 29, 2023
5f9ab5e
change {} to {} per BEM
XDRO Nov 29, 2023
ddb30b5
change alt text to item.name in itemCard.js
XDRO Nov 29, 2023
67e76c6
change alt text in itemModal to selectedCard.name
XDRO Nov 29, 2023
053955f
change AvatarLogo to avatarLogo sideBar.js
XDRO Nov 29, 2023
cb58714
remove extra function inside of onAddItem in app.js
XDRO Nov 29, 2023
f690aa0
update handleDeleteCard function
XDRO Nov 29, 2023
25a6534
ready for 3rd review
XDRO Nov 29, 2023
4a9f03b
add error handling at the end of every api request
XDRO Nov 29, 2023
cae377e
fix async/await function in onAddItem
XDRO Nov 30, 2023
d45d6ac
remove processServerRespone from console.error
XDRO Nov 30, 2023
1b5e97a
remove processServerResponse import
XDRO Nov 30, 2023
0ae5c27
change values to res in onAddItem
XDRO Dec 1, 2023
8422be9
commit to reopen repo
XDRO Jan 17, 2024
ecdc87a
create LoginModal and RegisterModal folders
XDRO Jan 18, 2024
dbc5591
Create auth for register and authorize, and create jsx in registerModal
XDRO Jan 18, 2024
f6cfe87
add curentUserContent js and try to use symlink
XDRO Jan 18, 2024
4c5be20
remove symlink from package.json, then run npm update
XDRO Jan 18, 2024
e63c820
add modal for login, create getCurrentUser function in api.js
XDRO Jan 18, 2024
ebd4464
Change currentUserContext, make profile a protected route
XDRO Jan 18, 2024
b0dbb30
continue working on registration and logging in
XDRO Jan 19, 2024
529577c
update auth register to have only name, password, email
XDRO Jan 19, 2024
a9111f2
refactor const values in login modal and redister modal
XDRO Jan 19, 2024
6a9ebcb
auth.register add values. to each field i.e. name, password, email
XDRO Jan 19, 2024
62288ba
update handleChange in login and register
XDRO Jan 19, 2024
b963140
work on handleSubmit function and auth.js
XDRO Jan 19, 2024
f973859
remove comment from auth.js
XDRO Jan 19, 2024
9d375cf
get register modal to redirect users to the login page using hisotry.…
XDRO Jan 19, 2024
9904030
add checkToken() fetch request
XDRO Jan 20, 2024
1b8bbf7
create a history.push("/register") for users who try to log in and ar…
XDRO Jan 20, 2024
495a068
pass setLoggedIn to register so on registering the user is sent to th…
XDRO Jan 20, 2024
caca607
add Authorization to all api calls
XDRO Jan 20, 2024
ad29279
work on getting currentUser
XDRO Jan 21, 2024
97098d1
work on getting the current user data
XDRO Jan 21, 2024
0a035d6
get useEffect for getting the users token to work
XDRO Jan 23, 2024
7121d71
create placeholder for avatar image
XDRO Jan 23, 2024
7d1de38
change isLoggedIn to loggedIn and setLoggedIn to isLogged in everywhere
XDRO Jan 23, 2024
6bcc614
conditionally render palceholder
XDRO Jan 23, 2024
700f27f
add more conditional rendering to avatar
XDRO Jan 23, 2024
130634c
get the conditional rendering for the avatar and the link to work
XDRO Jan 23, 2024
bcc1e23
work on getting user token on add item
XDRO Jan 24, 2024
190bc81
continue to wotk on add item authorization
XDRO Jan 24, 2024
df0ecd0
refactor name link weatherType in values add item modal
XDRO Jan 24, 2024
84b42a5
add back old code for setting name, link and weatherType
XDRO Jan 24, 2024
fe624c4
get both delete and add item functions to work by passing in token to…
XDRO Jan 24, 2024
1cefb73
prop drill onCardLike and handleCardLike function through main, and p…
XDRO Jan 25, 2024
58a0fe3
work on adding likes to card
XDRO Jan 25, 2024
f065aad
get like and remove like to work
XDRO Jan 25, 2024
31de9e6
remove isliked form likeRemove in handCardLike App.js
XDRO Jan 25, 2024
7beb475
create className const for likeButton
XDRO Jan 25, 2024
2716618
work on currentUser not being defined when aa user is not logged in
XDRO Jan 25, 2024
f3c6efa
work on edit profile
XDRO Jan 26, 2024
a50c20a
work on edit profile modal and api
XDRO Jan 27, 2024
1669b97
work on edit save const in app
XDRO Jan 27, 2024
e181087
get the values to be reflected after save and refresh.
XDRO Jan 27, 2024
19624c9
create logOut, refactor register and login modals to open
XDRO Jan 27, 2024
5a14e88
remove old readme.md
XDRO Jan 27, 2024
0b96475
remove use of api import
XDRO Jan 27, 2024
9947e14
add link to readme to backend
XDRO Jan 27, 2024
ca8ea68
delete edit rpofile modal css file
XDRO Jan 27, 2024
d7c64a6
remove unused handlers
XDRO Jan 27, 2024
83b3052
add a useEffect for handling enter key, also remove preventDefault as…
XDRO Jan 29, 2024
6dace81
add loggedIn into itemCard to render the like button ? or :
XDRO Jan 29, 2024
7c2cb0f
conditionally render add clothes button
XDRO Jan 29, 2024
7578a24
get login and register open on main
XDRO Jan 29, 2024
b10dbc5
get login and register to open on click of link
XDRO Jan 29, 2024
afb969e
get logout to work
XDRO Jan 29, 2024
6a7f3aa
turn userPlaceHolder component into an async function
XDRO Jan 29, 2024
47812d0
add a media query to weather for 320px
XDRO Jan 29, 2024
ddfcc7a
add conditional rendering for image and name in sidebar
XDRO Jan 29, 2024
4cbcb61
remove onCreate in header, and replace with onClick
XDRO Jan 30, 2024
717eb8f
get rid of handleOpenEditModal replace with handleOpenModal
XDRO Jan 30, 2024
db41bc4
remove handleDeleteOpenModal function
XDRO Jan 30, 2024
00f066d
remove handleCreateFunction
XDRO Jan 30, 2024
f83b332
remove handle openCreateModal function
XDRO Jan 30, 2024
fea0164
add withRouter to App export
XDRO Jan 30, 2024
6c87286
change toggleSwitch into an async function
XDRO Jan 30, 2024
7e1fcbc
move current date to the rest of the consts
XDRO Jan 30, 2024
891f125
add e.preventDefault to login and to handleSubmit in loginModal
XDRO Jan 30, 2024
03df4cd
remove async from UserPlaceHolder functional component
XDRO Jan 30, 2024
6064b62
change is loggedIn to isLogged in across App profile and main, as wel…
XDRO Jan 30, 2024
db64e00
conditionally render items based on the owner for profile
XDRO Jan 30, 2024
71ba374
work on rendering the edited profile info on submit
XDRO Jan 30, 2024
1c935d9
reflect changes on edit submit
XDRO Jan 30, 2024
e55438b
remove console log from setUserInfo function
XDRO Jan 30, 2024
e68fe2e
consert all api.js function into async
XDRO Jan 30, 2024
e7694c5
refactor auth.js into async functions
XDRO Jan 30, 2024
1079583
get things working again i.e. login
XDRO Jan 30, 2024
c89c538
set current user to null on logout
XDRO Jan 30, 2024
f72b777
pass event into the useEffect function inside of loginModal
XDRO Jan 30, 2024
6a9b653
rmeove unused object
XDRO Jan 30, 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
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Binary file added FooterSS.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 HeaderSS.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 ItemCardSS.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 MainSS.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 ModalWithFormSS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
162 changes: 157 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,161 @@
# WTWR (What to Wear?)
## Project name: se_project_react

## About the project
<a href="https://xdro.github.io/se_project_react/">Click here to view my webiste!</a>
<a href="https://github.com/XDRO/se_project_express">Click here to check out the backend of this baby!</a>

The idea of the application is pretty simple - we make a call to an API, which then responds with the daily weather forecast. We collect the weather data, process it, and then based on the forecast, we recommend suitable clothing to the user.
## This project contains the following:

## Links
The index.css and index.js files.
The index.html file is stored in the public folder.
CSS files with styles for corresponding componenets.

- [Figma Design](https://www.figma.com/file/DTojSwldenF9UPKQZd6RRb/Sprint-10%3A-WTWR)
A components directory, which contains the following components:
App.js, Footer.js, Header.js, ItemCard.js, ItemModal.js, Main.js, ModalWithForm.js, and
WeatherCard.js.

This project also contains Prop drilling, Prop drilling is the process of passing down data or state through multiple layers of a component hierarchy.

## App.js:

This is where all of the other JS files are imported to.
It contains functions such as, useEffect, UseState, and React.
Other functions include handling all other operations of the page.
This file contains clear and concise function names to help you understand the functions and the actions they preform at first glance.

## Footer:

This folder contains the creator's name(My name), as well as the copyright located in the (Footer.js) file, as well as it's corresponding css file (Footer.css).

## Screen shot:

![Footer Image](FooterSS.png)

## Header:

This folder is everything that corresponds to the Header, such as (Header.js) file, which is where the HTML that has all of the images linked to the header is stored. This file also contains Prop drilling, and is where the current date is stored. The (Header.css) file contains flex-box(display: flex) which is what is used to position everything in the header.

## Screen shot:

![Header image](HeaderSS.png)

## ItemCard:

This is where the item cards are stored(ItemCard.js).This file is very easy to comprehend, and to understand what is exactly is happening here.(ItemCard.css) is where the cards are styled, using(display: inline-block), as well as (position: relative) in order to keep elements exactly as they are when the page is re-sized. When using media queryies this component becomes just as easy to change while keeping everything in place.

## Screen shot:

![Item card image](ItemCardSS.png)

## ItemModal:

(ItemModal.js) adds more functionality to the ItemCards, as well having a responsive design when the temperature changes.

## Screen shot:

link is provided as ItemCardSS.png

## Main:

(Main.js) this is where all of the cards are filtered to select the cards that correspond to the given temperature values. This is also where the temperatures are connected through the {weatherTemp} Prop.
(Main.css) is where the padding is applied so the content never touches the edge of the screen.

## Screen shot:

![Main image](MainSS.png)

## ModalWithForm:

(ModalWithForm.js) is a general layout where any forms that I may want to add in the future could use as a template.
(ModalWithForm.css) this is how the modal is positioned, styled, and overlay is added, so that users can have a better UI/UX experience.

## Screen shot:

![Modal with form image](ModalWithFormSS.png)

## WeatherCard:

This folder contains the corresponding JS(WeatherCard.js) file and css(WeatherCard.css) file.
Inside of the of the (WeatherCard.js) file, is where you can find the function that filters through each image to display the corresponding image to the corresponding value you. Currently day=true and type="Sunny" so the weather image that is displayed, has those corresponding values. It also stores the {weatherTemp} on the image that is displayed.
The (WeatherCard.css) is where the image is positioned, using both (position: relative) and (position: absolute).

## Screen shot:

![Weather card image](WeatherCardSS.png)

## utils

This folder contains the (Constants.js) file and the (WeatherApi.js) file.
(Constants.js) is where all of the const variables are stored, so that they can be exported, and then imported into any file.
(WeatherApi.js) is where I created a fetch function to retrieve all data that corresponds to the weather, as well as the location.

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This project was made with the following approach: HTML, JS and CSS files are located together inside of folders, grouped by component, making it easy to navigate.

## 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)
Binary file added WeatherCardSS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading