fix: update translations

This commit is contained in:
yassinedorbozgithub 2024-11-27 19:15:43 +01:00
parent 6f210b7350
commit 228508dea7
3 changed files with 15 additions and 8 deletions

View File

@ -300,6 +300,7 @@
"from_channels": "Target channels", "from_channels": "Target channels",
"simple_text": "Simple Text", "simple_text": "Simple Text",
"quick_replies": "Quick Replies", "quick_replies": "Quick Replies",
"button": "Button",
"buttons": "Buttons", "buttons": "Buttons",
"web_url": "Web URL", "web_url": "Web URL",
"payload": "Payload", "payload": "Payload",

View File

@ -300,6 +300,7 @@
"from_channels": "Cibler les canaux", "from_channels": "Cibler les canaux",
"simple_text": "Texte simple", "simple_text": "Texte simple",
"quick_replies": "Réponses rapides", "quick_replies": "Réponses rapides",
"button": "Boutton",
"buttons": "Boutons", "buttons": "Boutons",
"web_url": "URL Web", "web_url": "URL Web",
"payload": "Payload", "payload": "Payload",

View File

@ -71,12 +71,14 @@ export const PostbackInput = ({
{ {
label: t("label.get_started"), label: t("label.get_started"),
value: "GET_STARTED", value: "GET_STARTED",
type: PayloadType.button,
group: "general", group: "general",
}, },
{ {
label: t("label.view_more"), label: t("label.view_more"),
value: "VIEW_MORE", value: "VIEW_MORE",
type: PayloadType.button,
group: "general", group: "general",
}, },
{ {
@ -107,7 +109,8 @@ export const PostbackInput = ({
.map((btn) => ({ .map((btn) => ({
label: btn.title, label: btn.title,
value: btn.payload, value: btn.payload,
group: "buttons", type: PayloadType.button,
group: "button",
})), })),
[block?.previousBlocks, getBlockFromCache], [block?.previousBlocks, getBlockFromCache],
); );
@ -134,8 +137,8 @@ export const PostbackInput = ({
id: btn.payload as string, id: btn.payload as string,
label: btn.title as string, label: btn.title as string,
value: btn.payload as string, value: btn.payload as string,
type: PayloadType.menu, type: PayloadType.quick_reply,
group: "quick_replies", group: "quick_reply",
})), })),
[block?.previousBlocks], [block?.previousBlocks],
); );
@ -199,7 +202,7 @@ export const PostbackInput = ({
const isOptionsReady = const isOptionsReady =
!defaultValue || options.find((o) => isSamePostback(o, defaultValue)); !defaultValue || options.find((o) => isSamePostback(o, defaultValue));
if (!isOptionsReady) { if (!isOptionsReady || isLoadingContent || isLoadingMenu) {
return ( return (
<Skeleton animation="wave" variant="rounded" width="100%" height={40} /> <Skeleton animation="wave" variant="rounded" width="100%" height={40} />
); );
@ -212,6 +215,7 @@ export const PostbackInput = ({
<Autocomplete <Autocomplete
size="small" size="small"
defaultValue={selected} defaultValue={selected}
value={selected}
options={options} options={options}
multiple={false} multiple={false}
onChange={(_e, value) => { onChange={(_e, value) => {
@ -244,18 +248,19 @@ export const PostbackInput = ({
<InputAdornment position="start"> <InputAdornment position="start">
<Chip <Chip
sx={{ sx={{
position: "relative",
left: "8px", left: "8px",
height: "25px", height: "25px",
fontSize: "12px", fontSize: "12px",
minWidth: "75px", minWidth: "75px",
position: "relative",
maxHeight: "30px", maxHeight: "30px",
borderRadius: "16px 0 0 16px", borderRadius: "16px",
borderRight: "none",
borderColor: theme.palette.grey[400], borderColor: theme.palette.grey[400],
}} }}
color="primary" color="primary"
label={selectedValue?.type || t("label.postback")} label={t(
`label.${selectedValue?.type || "postback"}`,
).toLocaleLowerCase()}
variant="role" variant="role"
/> />
</InputAdornment> </InputAdornment>