Skip to content

Commit

Permalink
fix: added and updated some texts and added early return on clicking …
Browse files Browse the repository at this point in the history
…'no layout'-selection
  • Loading branch information
malmen237 committed Nov 8, 2024
1 parent e597cf7 commit 49840a5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/modal/configureOutputModal/Decision.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ interface IDecision {
onClose: () => void;
onSave: () => void;
className?: string;
buttonText?: string;
}

export default function Decision({ onClose, onSave, className }: IDecision) {
export default function Decision({
onClose,
onSave,
className,
buttonText
}: IDecision) {
const t = useTranslate();

return (
Expand All @@ -17,7 +23,7 @@ export default function Decision({ onClose, onSave, className }: IDecision) {
}`}
>
<Button className="hover:bg-red-500" onClick={onClose} state="warning">
{t('close')}
{buttonText ? buttonText : t('close')}
</Button>
<Button
className="relative flex hover:bg-green-400"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export default function MultiviewLayoutSetup({

switch (type) {
case 'layout':
if (availableMultiviewLayouts.length === 0) return;
setNewPresetName(name || '');
if (chosenLayout) {
setIsChecked(false);
Expand All @@ -169,7 +170,7 @@ export default function MultiviewLayoutSetup({
};

const handleChange = (viewId: string, value: string) => {
if (inputList && availableMultiviewLayouts) {
if (inputList) {
const emptyView = {
id: '',
input_slot: 0,
Expand Down Expand Up @@ -253,7 +254,7 @@ export default function MultiviewLayoutSetup({
? multiviewLayoutNames.map((singleItem) => ({
label: singleItem
}))
: [{ label: 'No layouts available' }]
: [{ label: t('preset.no_avaliable_layouts') }]
}
value={selectedMultiviewPreset?.name || ''}
update={(value) => handleLayoutUpdate(value, 'layout')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export default function ProductionMultiviews(props: ProductionMultiviewsProps) {
<div className="flex flex-col">
<Decision
className="mt-6"
buttonText={t('clear')}
onClose={() => clearInputs()}
onSave={() => onSave()}
/>
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ export const en = {
multiview_output_settings: 'Multiview output',
select_multiview_layout: 'Layout',
configure_layouts: 'Configure layouts',
no_avaliable_layouts: 'No available layouts',
create_layout: 'Create new layout',
update_layout: 'Update layout',
no_updated_layout: 'No layout updated',
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ export const sv = {
no_multiview_found: 'Hittade ingen multiview',
select_multiview_layout: 'Komposition',
configure_layouts: 'Justera kompositioner',
no_avaliable_layouts: 'Inga kompositioner finns',
create_layout: 'Skapa komposition',
update_layout: 'Uppdatera komposition',
no_updated_layout: 'Ingen uppdaterad komposition',
Expand Down

0 comments on commit 49840a5

Please sign in to comment.