-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AC-258 favorite feature and btn float added
- Loading branch information
Minotriz02
authored and
Minotriz02
committed
Nov 13, 2024
1 parent
dadd3b4
commit 4d7a80a
Showing
5 changed files
with
153 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.btn-floating-compare { | ||
right: 23px; | ||
bottom: 23px; | ||
z-index: 1000; | ||
} | ||
|
||
.btn-floating-download { | ||
right: 23px; | ||
bottom: 73px; | ||
z-index: 1000; | ||
} | ||
|
||
.btn-floating-favorite { | ||
right: 23px; | ||
bottom: 123px; | ||
z-index: 1000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from "react"; | ||
import "./FloatingButton.css"; | ||
import { Button, OverlayTrigger, Tooltip } from "react-bootstrap"; | ||
import { | ||
IconFileDownload, | ||
IconSatellite, | ||
IconStar, | ||
IconStarFilled, | ||
} from "@tabler/icons-react"; | ||
|
||
const FloatingButton = ({ type, onClick, isFavorite }) => { | ||
let icon; | ||
let label; | ||
|
||
switch (type) { | ||
case "favorite": | ||
icon = isFavorite ? <IconStarFilled /> : <IconStar />; | ||
label = "Favorito"; | ||
break; | ||
case "download": | ||
icon = <IconFileDownload />; | ||
label = "Descargar Datos"; | ||
break; | ||
case "compare": | ||
icon = <IconSatellite />; | ||
label = "Comparar con datos satelitales"; | ||
break; | ||
default: | ||
icon = null; | ||
label = ""; | ||
} | ||
|
||
return ( | ||
<OverlayTrigger | ||
placement="left" | ||
overlay={<Tooltip id={`tooltip-${type}`}>{label}</Tooltip>} | ||
> | ||
<Button | ||
variant="primary text-light" | ||
className={`position-fixed shadow rounded-5 btn-floating-${type}`} | ||
onClick={onClick} | ||
> | ||
{icon} | ||
</Button> | ||
</OverlayTrigger> | ||
); | ||
}; | ||
|
||
export default FloatingButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
.bg-dashboard { | ||
background-color: #f1f1f1; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters