Skip to content

Commit

Permalink
it works!
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Aug 2, 2024
1 parent 94f7c05 commit 8001316
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui2/src/components/SearchResults/ActionButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import {Group} from "@mantine/core"
import ToggleSecondaryPanel from "@/components/DualPanel/ToggleSecondaryPanel"
import GoBackButton from "./GoBackButton"

export default function ActionButtons() {
return (
<Group justify="space-between">
<Group>Some button here</Group>
<Group>
<GoBackButton />
</Group>
<Group>
<ToggleSecondaryPanel />
</Group>
Expand Down
22 changes: 22 additions & 0 deletions ui2/src/components/SearchResults/GoBackButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {Tooltip, ActionIcon} from "@mantine/core"
import {IconArrowLeft} from "@tabler/icons-react"
import {useNavigate} from "react-router-dom"
import {selectCurrentUser} from "@/slices/currentUser"
import {useSelector} from "react-redux"

export default function GoBackButton() {
const user = useSelector(selectCurrentUser) as User
const navigate = useNavigate()

const onClick = () => {
navigate(`/home/${user.home_folder_id}`)
}

return (
<Tooltip label="Go back to home folder" withArrow>
<ActionIcon size={"lg"} variant="default" onClick={onClick}>
<IconArrowLeft stroke={1.4} />
</ActionIcon>
</Tooltip>
)
}

0 comments on commit 8001316

Please sign in to comment.