Skip to content

Commit

Permalink
update frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin1999Stark committed Aug 30, 2024
1 parent 574d490 commit 00a6729
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Frontend/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ function App() {
</Suspense>
</main>
{/* Placeholder for mobile bottom nav bar */}
<span className={`${windowSize.width > SIZE_MOBILE ? 'hidden' : 'block'} h-[90px]`}>
<span className={`${windowSize.width > SIZE_MOBILE ? 'hidden' : 'block'} h-[70px]`}>
</span>
{/* Placeholder for mobile bottom nav bar */}
<span className={`${windowSize.width <= SIZE_MOBILE && showMITNav ? 'block' : 'hidden'} h-[4.2rem]`}>
<span className={`${windowSize.width <= SIZE_MOBILE && showMITNav ? 'block' : 'hidden'} h-[70px]`}>
</span>
</span>
</>
Expand Down
17 changes: 12 additions & 5 deletions Frontend/frontend/src/Components/MealDragElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'react-datepicker/dist/react-datepicker.css';
import CustomDatePicker from './CustomDatePicker';
import LoadingSpinner from './LoadingSpinner';
import { getMeal } from '../Endpoints/MealService';
import { useNavigate } from 'react-router-dom';

type Props = {
mealID: number
Expand Down Expand Up @@ -39,6 +40,8 @@ function MealDragElement({ mealID, dragProvided, snapshot, date, customStyle, on
const [imageError, setImageError] = useState<boolean>(false);
const datePickerRef = useRef<HTMLDivElement>(null);

const navigate = useNavigate();

useEffect(() => {
async function fetchMeal() {
try {
Expand Down Expand Up @@ -147,17 +150,21 @@ function MealDragElement({ mealID, dragProvided, snapshot, date, customStyle, on
)}
</figure>
{
meal !== undefined ? <a className='text-[#011413] underline' href={`/meals/${meal!.id}`}>
<h1 className='text-start'>
meal !== undefined ?
<h1
onClick={() => navigate(`/meals/${meal!.id}`)}
className='text-start text-[#011413] underline'>
{meal?.title}
</h1>
</a> : <LoadingSpinner />
: <LoadingSpinner />
}
</article>
{
showMore ?
<Menu menuButton={<MenuButton><IoIosMore className='size-5 text-[#011413] mr-3' /></MenuButton>} transition>
<MenuItem>Öffnen</MenuItem>
<Menu menuButton={<MenuButton><IoIosMore className='size-5 text-[#011413] mr-3 cursor-pointer' /></MenuButton>} transition>
<MenuItem onClick={() => {
navigate(`/meals/${meal!.id}`)
}}>Öffnen</MenuItem>
<MenuItem onClick={() => {

handleRemoveMeal(date, mealID)
Expand Down
4 changes: 2 additions & 2 deletions Frontend/frontend/src/Views/IngredientsOverView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ function IngredientsOverView() {
clearTimeout(debounceTimeout);
}
}}
autoFocus={true}
autoFocus={false}
className='bg-white w-full focus:ring-0 py-2 text-start shadow-md px-6 rounded-full mr-2'
placeholder='Nach Zutaten Suchen ...' />
placeholder='Zutaten Suchen ...' />
<button
className='p-3 text-lg bg-[#046865] text-white rounded-full'
onClick={() => searchForIngredients(searchString)} >
Expand Down
4 changes: 2 additions & 2 deletions Frontend/frontend/src/Views/MealsOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ function MealsOverview() {
clearTimeout(debounceTimeout);
}
}}
autoFocus={true}
autoFocus={false}
className='bg-white w-full focus:ring-0 py-2 text-start shadow-md px-6 rounded-full mr-2'
placeholder='Nach Rezepten Suchen ...' />
placeholder='Rezepte Suchen ...' />
<button
className='p-3 text-lg bg-[#046865] text-white rounded-full'
onClick={() => searchForMeals(searchString)} >
Expand Down
5 changes: 2 additions & 3 deletions Frontend/frontend/src/Views/TagsOverView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ function TagsOverView() {
setSearchString(e.target.value);
searchForTags(e.target.value.trim());
}}
autoFocus={true}
autoFocus={false}
className='bg-white w-full focus:ring-0 py-2 text-start shadow-md px-6 rounded-full mr-2'
placeholder='Nach Tags Suchen ...' />

placeholder='Tags Suchen ...' />
<button
className='p-3 text-lg bg-[#046865] text-white rounded-full'
onClick={() => searchForTags(searchString)} >
Expand Down

0 comments on commit 00a6729

Please sign in to comment.