Skip to content
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

Re-add everything for review #1

Open
wants to merge 1 commit into
base: delete-everything
Choose a base branch
from

Conversation

billy1kaplan
Copy link
Collaborator

No description provided.

brewlette-backend/app.js Show resolved Hide resolved
brewlette-backend/app.js Show resolved Hide resolved
brewlette-frontend/README.md Show resolved Hide resolved
brewlette-frontend/public/logo192.png Show resolved Hide resolved
brewlette-frontend/src/neighborhoods.js Show resolved Hide resolved
brewlette-frontend/src/components/CafeMenu.js Show resolved Hide resolved
brewlette-frontend/src/App.js Show resolved Hide resolved
brewlette-frontend/src/api/api.js Show resolved Hide resolved
brewlette-frontend/src/App.js Show resolved Hide resolved
Comment on lines +12 to +16
const [neighborhood, setNeighborhood] = useState("");
const [count, setCount] = useState(0);
const [coords, setCoords] = useState("");
const [cafes, setCafes] = useState([]);
const [cafe, setCafe] = useState(null);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be helpful to think about what the complete data model needed for this app is. It seems to be something like:

AppState = {
  neighborhoods: String[],
  neighborhood: String,
  coords: String,
  cafes: Cafe[],
  selectedCafe: CafeDetail,
  count: number;
}

// It seems like a few changes could be:

AppState = {
  neighborhoods: String[],
  neighborhood: {
    name: String,
    coords: {
      lat: number,
      lng: number
    },
    cafes: Cafe[],
    cafeIndex: number,
  },
  selectedCafe: CafeDetail,
}

// I think this is equivalent but captures the idea that the coordinates, cafes, and currently selected cafe index are properties of a neighborhood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant