Skip to content

Commit 18618df

Browse files
authored
Merge pull request #156 from oasisprotocol/csillag/more-customization-settings
Csillag/more customization settings
2 parents 08227db + 0be31c2 commit 18618df

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

frontend/src/components/Card/index.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
min-width: 640px;
1212
max-width: 640px;
1313

14-
min-height: 496px;
14+
min-height: 300px;
1515
padding: 2.25rem 2.6875rem 1.875rem;
1616
margin: 0 auto 16px;
1717
/*border-radius: 12px;*/

frontend/src/components/InputFields/useOneOfField.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type OneOfFieldProps<DataType = string> = Omit<
1818
requiredMessage?: string
1919
hideDisabledChoices?: boolean
2020
disableIfOnlyOneVisibleChoice?: boolean
21+
hideIfDisabled?: boolean
2122
}
2223

2324
export type OneOfFieldControls<DataType> = InputFieldControls<DataType> & {
@@ -30,6 +31,7 @@ export function useOneOfField<DataType>(props: OneOfFieldProps<DataType>): OneOf
3031
requiredMessage = 'Please select an option!',
3132
hideDisabledChoices,
3233
disableIfOnlyOneVisibleChoice,
34+
hideIfDisabled,
3335
} = props
3436
const visibleChoices = choices.filter(
3537
choice => !choice.hidden && (!hideDisabledChoices || getVerdict(choice.enabled, true)),
@@ -61,6 +63,7 @@ export function useOneOfField<DataType>(props: OneOfFieldProps<DataType>): OneOf
6163

6264
return {
6365
...controls,
66+
visible: controls.visible && (controls.enabled || !hideIfDisabled),
6467
choices,
6568
}
6669
}

frontend/src/constants/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export const designDecisions = {
123123
showInaccessiblePollCheckbox: true,
124124
hideDisabledSelectOptions: true,
125125
disableSelectsWithOnlyOneVisibleOption: true,
126+
hideDisabledSelects: true,
126127
showSubmitButton: false,
127128
hidePollCardsWithErrors: true,
128129
hideHardwiredSettings: false,

frontend/src/pages/CreatePollPage/useCreatePollForm.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ export const useCreatePollForm = () => {
219219
enabled: isFrozen ? deny(frozenMassage) : !VITE_APP_HARDWIRED_RESULTS_DISPLAY,
220220
visible: !designDecisions.hideHardwiredSettings || !VITE_APP_HARDWIRED_RESULTS_DISPLAY,
221221
hideDisabledChoices: designDecisions.hideDisabledSelectOptions,
222+
hideIfDisabled: designDecisions.hideDisabledSelects,
222223
} as const)
223224

224225
const authorResultDisplayType = useOneOfField({
@@ -252,6 +253,7 @@ export const useCreatePollForm = () => {
252253
],
253254
hideDisabledChoices: designDecisions.hideDisabledSelectOptions,
254255
disableIfOnlyOneVisibleChoice: designDecisions.disableSelectsWithOnlyOneVisibleOption,
256+
hideIfDisabled: designDecisions.hideDisabledSelects,
255257
} as const)
256258

257259
const hasCompletionDate = useBooleanField({

0 commit comments

Comments
 (0)