Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 0435a23

Browse files
authored
TILA-2095: add tooltips to reservation form (#686)
1 parent f84096b commit 0435a23

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

admin-ui/src/component/my-units/BufferToggles.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { Controller, useFormContext } from "react-hook-form";
3-
import { Checkbox } from "hds-react";
3+
import { Checkbox, Tooltip } from "hds-react";
44
import { useTranslation } from "react-i18next";
55
import styled from "styled-components";
66

@@ -42,6 +42,12 @@ const Wrapper = styled.div`
4242
gap: var(--spacing-s);
4343
`;
4444

45+
const LabelWithTooltip = styled.div`
46+
display: flex;
47+
flex-direction: row;
48+
gap: var(--spacing-xs);
49+
`;
50+
4551
const BufferToggles = ({
4652
before,
4753
after,
@@ -52,7 +58,10 @@ const BufferToggles = ({
5258
const { t } = useTranslation();
5359
return (
5460
<Wrapper>
55-
<div>{t("reservationApplication:buffers.label")}</div>
61+
<LabelWithTooltip>
62+
{t("reservationApplication:buffers.label")}
63+
<Tooltip>{t("reservationApplication:buffers.tooltip")}</Tooltip>
64+
</LabelWithTooltip>
5665
{before && <BufferController name="bufferTimeBefore" seconds={before} />}
5766
{after && <BufferController name="bufferTimeAfter" seconds={after} />}
5867
</Wrapper>

admin-ui/src/component/my-units/ReservationTypeForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const TypeSelect = ({
7171
? t(`reservationForm:errors.${errors.type?.message}`)
7272
: ""
7373
}
74+
tooltipText={t("reservationApplication:typeSelection.tooltip")}
7475
>
7576
{ReservationTypes.filter((x) => x !== "NORMAL").map((v) => (
7677
<RadioButton

admin-ui/src/i18n/locales/fi/reservationApplication.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"reserveeTypePrefix": "Varaan",
33
"type": "Varauksen tyyppi",
4+
"typeSelection": {
5+
"tooltip": "Sisäisissä varauksissa vastuu tilaisuudesta on aina kaupungilla. Ulkoisissa varauksissa vastuu tilaisuudesta on asiakkaalla. Vastuuhenkilö on nimettävä varauksella."
6+
},
47

58
"buffers": {
69
"label": "Varauksen tauko",
10+
"tooltip": "Asiakaspuolella varauksiin lisätään aina automaattinen tauko. Voit lisätä varauksesi alkuun tai loppuun tauon tässä.",
711
"bufferTimeBefore": "Ennen vuoroa ({{minutes}} min)",
812
"bufferTimeAfter": "Vuoron jälkeen ({{minutes}} min)"
913
},

0 commit comments

Comments
 (0)