buidlingreactUI #27
Loading…
Reference in a new issue
No description provided.
Delete branch "buidlingreactUI"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created frontend of a form to create events.
@ -0,0 +24,4 @@"react-router-dom": "^7.18.0","zod": "^4.4.3"},"devDependencies": {why are dev dependencies different from prod dependencies?
@ -0,0 +1,184 @@.counter {is it react standard for the file to be uppercase App.css? having an uppercase letter in file is weird and i would only do it if it was required by react
@ -0,0 +22,4 @@.base,.framework,.vite {what actually is vite, why is it required
@ -0,0 +56,4 @@}}#center {are these better as ids or classes?
@ -0,0 +104,4 @@}}#next-steps ul {i feel like a lot of these names are ambiguous. like next steps what, docs what? I imagine we will have a documentation page.
@ -0,0 +115,4 @@height: 18px;}a {this implies we will have multiple link styles... i would take a look at a lot of your nested css and see if there are things that could be put at the global level, why do we need a special link here, it is just going to lead to an inconsistent UI
@ -0,0 +1,62 @@import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet';all imports should at least be in some sort of alphabetical order. idk how best to do that in react tho
@ -0,0 +2,4 @@import { useMapEvents } from 'react-leaflet';import { Routes, Route, Link } from "react-router-dom";import EventForm from './components/eventForm.jsx'; // <- add this importwhat is a .jsx file anyway?
@ -0,0 +3,4 @@import { Routes, Route, Link } from "react-router-dom";import EventForm from './components/eventForm.jsx'; // <- add this importfunction ClickHandler() {this function is just for debugging, probably should not be in master
@ -0,0 +17,4 @@}// src/App.jsxfunction Home() {the lower function has export default function but this one just has function, why?
what do these functions even do?
@ -0,0 +29,4 @@export default function App() {return (<div><Routes>this has routes, the other doesn't, why?
@ -0,0 +37,4 @@);}// export default function App() {delete commented code
@ -0,0 +1,124 @@/* eventForm.css */damn okay. we have a lot of css in multiple files. you need to probably really create a single css file and inherit it in most cases, with only minor tweaks for each page.
@ -0,0 +5,4 @@- When a place is chosen, address + coordinates are written into the form values- Coordinates are submitted as flat fields; the schema transforms them into `location`*/import React, {useEffect, useState} from "react";organize imports better
@ -0,0 +29,4 @@import markerRetinaUrl from "leaflet/dist/images/marker-icon-2x.png";import markerShadowUrl from "leaflet/dist/images/marker-shadow.png";L.Icon.Default.mergeOptions({what does this do?
@ -0,0 +48,4 @@watch,} = useForm({resolver: zodResolver(EventPostSchema),defaultValues: {this is good for dev, but we need to remove them for prod.
@ -0,0 +61,4 @@rain_date: "",email: "madeleienma07@gmail.com",phone_number: "8482189789",latitude: "", // hidden field for latituderemove ai slop comments
@ -0,0 +78,4 @@try {// Schema handles transformation - data is already nested as { location: { latitude, longitude } }await eventService.createEvent(data);alert("Your event has been created successfully");i dont love alerts for users. better to do message toast like django
@ -0,0 +144,4 @@// parse lat/lng from watched valuesconst markerPosition = (latitude && longitude) ? [parseFloat(latitude), parseFloat(longitude)] : null;return (why is this not in app.jsx then? im not saying to do that, but this is inconsistent.
@ -0,0 +167,4 @@{/* Map and search control */}<div style={{marginTop: 8}}>you can probably abstract the map html into its own component, because it is going to have to be reused again
@ -0,0 +185,4 @@</div></div><div>{/* Address input - if you want you can also update address automatically from search result */}ai slop comment
@ -0,0 +1,111 @@:root {damn, more css
@ -0,0 +30,4 @@}}@media (prefers-color-scheme: dark) {probably wana do prefers-color-scheme: system (idr if that is what it is tho)
@ -0,0 +9,4 @@export const EventPostSchema = z.object({name: z.string().min(1, "Name is required"),description: z.string().min(5, "Description has to be more than 5 letters."),what is the first integer in min function mean.
@ -0,0 +13,4 @@url: z.string().url().nullable().optional(),address: z.string().min(5, "Address is required"),status: z.enum(["scheduled", "completed", "canceled"]).optional(),seems like you have statuses written in two places, would be better if they were shared somehow
@ -0,0 +21,4 @@async createEvent(rawPayload) {// Validate and coerce the outgoing payloadconst parsed = EventPostSchema.parse(rawPayload); // will throw if invalidconsole.log("EventService sending payload:", JSON.stringify(rawPayload, null, 2)); // Log hereai slop comments and unnecessary console.log
@ -1,4 +1,8 @@import syswhy is this file in here?
Pull request closed