Skip to content

Commit

Permalink
fix(application): 🐛 Text Display
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudelsuppe42 committed Jan 13, 2024
1 parent 2b8a3e5 commit b3a1d1f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions src/components/application/questions/TextDisplay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Text } from '@mantine/core';
import { IconLetterT } from '@tabler/icons-react';
import { ApplicationQuestion } from '../../../utils/application/ApplicationQuestions';

export interface TextDisplayProps extends ApplicationQuestion {
additionalData: {};
}

function validation(props: TextDisplayProps): (value: string) => void {
return (value: string) => {
return false;
};
}

const TextDisplay = (props: TextDisplayProps) => {
return (
<>
<Text style={props.style}>{props.title}</Text>
{props.subtitle && (
<Text c="dimmed" size="sm">
{props.subtitle}
</Text>
)}
</>
);
};

const EditQuestion: any = undefined;

TextDisplay.edit = EditQuestion;
TextDisplay.mockdata = {};
TextDisplay.validation = validation;
TextDisplay.icon = IconLetterT;
export default TextDisplay;
3 changes: 2 additions & 1 deletion src/utils/application/ApplicationQuestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import ImageUploadQuestion from '../../components/application/questions/ImageUpl
import LongTextQuestion from '../../components/application/questions/LongTextQuestion';
import MinecraftQuestion from '../../components/application/questions/MinecraftQuestion';
import SliderQuestion from '../../components/application/questions/SliderQuestion';
import TextDisplay from '../../components/application/questions/TextDisplay';
import TextQuestion from '../../components/application/questions/TextQuestion';
import UrlQuestion from '../../components/application/questions/UrlQuestion';

export const ApplicationQuestions: { [key: string]: any } = {
TEXT: Text,
TEXT: TextDisplay,
SHORT_INPUT: TextQuestion,
LONG_INPUT: LongTextQuestion,
DROPDOWN: DropdownQuestion,
Expand Down

0 comments on commit b3a1d1f

Please sign in to comment.