Skip to content

Commit

Permalink
swiper when device is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiemann96 committed Sep 11, 2023
1 parent 34c298d commit b582525
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/Home/ConnectionSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export default function ConnectionSelection() {
<div className="flex h-full flex-col justify-center gap-10">
<div className="flex flex-col items-center text-center gap-5">
<div>
Super! Der Login hat funktioniert ! Jetzt müssen wir nur noch die Box mit dem Gerät verbinden.
Super! Der Login hat funktioniert und deine Box ist ausgewählt !
Jetzt müssen wir nur noch die Box mit dem Gerät verbinden.
</div>
<Image
alt="bike"
Expand Down
10 changes: 9 additions & 1 deletion src/components/Wizard/SelectDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import { Toggle } from "../ui/toggle";
import { Button } from "../ui/button";
import { cx } from "class-variance-authority";
import { useState } from "react";
import { useSwiper } from "swiper/react";

export default function SelectDevice() {
const boxes = useAuthStore((state) => state.boxes);

const swiper = useSwiper();
const [selectedBox, setSelectedBox] = useState("");
const selectBox = (box) => {
setSelectedBox(box);
Expand Down Expand Up @@ -45,7 +47,13 @@ export default function SelectDevice() {
))}{" "}
</ScrollArea>

<Button className="w-11/12 rounded-md border">Weiter</Button>
<Button
disabled={selectedBox === ""}
className="w-11/12 rounded-md border"
onClick={() => swiper.slideNext()}
>
Weiter
</Button>
</div>
</div>
);
Expand Down

0 comments on commit b582525

Please sign in to comment.