Skip to content

Commit

Permalink
Minor UI improvements and bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-buffard committed Oct 24, 2024
1 parent be9a118 commit 98d51b5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 0 additions & 1 deletion web/components/yachts/yacht/brokerino.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const Brokerino = ({ brokerino }: { brokerino: IBrokerino }) => (
</div>
<div className={"flex justify-end items-center gap-[1vh] flex-wrap"}>
{brokerino.socials.map((network) => {
console.log(network);
const Icon = ({
platform,
}: {
Expand Down
25 changes: 17 additions & 8 deletions web/components/yachts/yacht/details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Details = () => {
{ currency, units } = useViewContext(),
[photo, setPhoto] = useState<number | null>(null),
[disabled, disable] = useState<boolean>(false),
[expanded, expand] = useState<boolean>(false),
[expanded, expand] = useState<boolean>(data.description.length <= 1229),
t = useTranslations("yacht.details"),
locale = useLocale() as "en" | "fr",
[generating, generate] = useState<{ popup: boolean; state: boolean }>({
Expand Down Expand Up @@ -170,13 +170,21 @@ const Details = () => {
</>
)}
</div>
<button
type={"button"}
onClick={() => generate((prev) => ({ ...prev, popup: false }))}
className={`glass-button glass-button-dark ${generating.state && "hidden"}`}
>
{t("dismiss")}
</button>
{generating.state ? (
<p className={"text-rock-300"}>
&#x2248;{" "}
{((17.54 + 3.42 * data.photos.gallery.length) / 60).toFixed(0)}
<label className={"text-rock-300"}>min</label>
</p>
) : (
<button
type={"button"}
onClick={() => generate((prev) => ({ ...prev, popup: false }))}
className={`glass-button glass-button-dark`}
>
{t("dismiss")}
</button>
)}
</motion.div>
)}
</AnimatePresence>
Expand Down Expand Up @@ -229,6 +237,7 @@ const Details = () => {
<SwitchView props={{ view: "features", label: t("features") }} />
)}
<button
type={"button"}
onClick={async () => {
generate({ popup: true, state: true });
brochurize({
Expand Down
2 changes: 0 additions & 2 deletions web/context/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ export const ViewProvider = ({ children }: { children: React.ReactNode }) => {
setBookmarks(bookmarks.filter((bookmark) => bookmark !== id));
};

console.log(`COOKIES AGREEMENT HERE ===> ${Cookies.get("cookiesAgreed")}`);

useEffect(() => {
const assignRates = async () => {
const cached = {
Expand Down

0 comments on commit 98d51b5

Please sign in to comment.