update
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Sun, Moon } from 'lucide-react';
|
||||
import Timeline from './components/Timeline';
|
||||
import PhotoDetail from './components/PhotoDetail';
|
||||
import Admin from './components/Admin';
|
||||
import { fetchPhotos } from './data/photos';
|
||||
import { Settings, Sun, Moon } from 'lucide-react';
|
||||
|
||||
function App() {
|
||||
const [view, setView] = useState(() => {
|
||||
@@ -37,7 +37,11 @@ function App() {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadPhotos();
|
||||
const fetchAndSet = async () => {
|
||||
const data = await fetchPhotos();
|
||||
setPhotos(data);
|
||||
};
|
||||
fetchAndSet();
|
||||
}, [view]);
|
||||
|
||||
// Handle browser back/forward
|
||||
|
||||
Reference in New Issue
Block a user