Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: play and create choice cards long text handling #286

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/expo/src/screens/create-question/ChoiceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const MultiSelectCard: FC<MultiSelectCardProps> = ({
<>
<TouchableOpacity
key={choice.id}
className={`flex h-16 w-[85vw] flex-col flex-wrap items-center justify-evenly self-center rounded-2xl ${
className={`flex w-[85vw] flex-col flex-wrap items-center justify-evenly self-center rounded-2xl ${
choice.styles
} ${
errorState.choicesError[choice.id]?.length !== undefined ? "" : ""
Expand All @@ -334,11 +334,11 @@ export const MultiSelectCard: FC<MultiSelectCardProps> = ({
<CheckboxIcon />
</View>
)}
<View className="h-full w-full items-center justify-center">
<View className="w-full items-center justify-center">
<Text
className={`self-center text-center ${getTextSize(
choice.text ? choice.text : "Add answer",
)} font-bold text-white`}
)} w-[83%] font-bold text-white`}
>
{choice.text ? choice.text : "Add answer"}
</Text>
Expand Down Expand Up @@ -433,15 +433,15 @@ export const IdentificationCard: FC<IdentificationCardProps> = ({
<>
<TouchableOpacity
key={choice.id}
className={`flex h-16 w-[85vw] flex-col flex-wrap items-center justify-evenly self-center rounded-2xl ${
className={`flex w-[85vw] flex-col flex-wrap items-center justify-evenly self-center rounded-2xl ${
choice.styles
} ${
errorState.choicesError[choice.id]?.length !== undefined ? "" : ""
} p-5`}
onPress={handleOpenModal(choice.id)}
>
<>
<View className="h-full w-full items-center justify-center">
<View className="w-full items-center justify-center">
<Text
className={`self-center text-center ${getTextSize(
choice.text ? choice.text : "Add answer",
Expand Down
2 changes: 1 addition & 1 deletion apps/expo/src/screens/create-question/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ export const CreateQuestionScreen: FC = () => {
placeholderTextColor={"#757575"}
onFocus={handleTextInputFocus}
multiline
maxLength={200}
maxLength={150}
/>
</>
</View>
Expand Down
12 changes: 6 additions & 6 deletions apps/expo/src/screens/play-test/TestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const IdentificationCard = ({
</Text>
<TextInput
multiline={false}
maxLength={75}
maxLength={65}
className="mx-5 mb-8 h-[15%] flex-col items-center justify-center rounded-2xl bg-emerald-500 p-2 text-center text-lg font-bold leading-[28.80px] text-white"
selectionColor="white"
value={answer}
Expand All @@ -162,9 +162,9 @@ export const IdentificationCard = ({
.map((choice) => (
<View
key={choice.id}
className={`inline-flex h-[50px] w-[85%] flex-col items-center justify-center rounded-2xl ${choice.styles}`}
className={`inline-flex w-[85%] flex-col items-center justify-center rounded-2xl ${choice.styles}`}
>
<Text className="font-nunito-extrabold self-stretch text-center text-sm font-bold leading-[28.80px] text-white">
<Text className="font-nunito-extrabold mx-4 self-stretch text-center text-sm font-bold leading-[28.80px] text-white">
{choice.text}
</Text>
</View>
Expand Down Expand Up @@ -228,7 +228,7 @@ export const MultiSelectCard = ({
<TouchableOpacity
key={choice.id}
disabled={isDone}
className={`flex h-16 w-[85vw] flex-col flex-wrap items-center justify-evenly self-center rounded-2xl ${
className={`flex w-[85vw] flex-col flex-wrap items-center justify-evenly self-center rounded-2xl ${
isDone ? doneStyle : choice.styles
} p-5`}
onPress={handlePressChoice(choice.id)}
Expand All @@ -243,9 +243,9 @@ export const MultiSelectCard = ({
{isSelected ? <CheckIcon /> : ""}
</View>
) : null}
<View className="h-full w-full items-center justify-center">
<View className="w-full items-center justify-center">
<Text
className={`self-center text-center ${getTextSize(
className={`w-[83%] self-center text-center ${getTextSize(
choice.text || "",
)} font-bold text-white`}
>
Expand Down
Loading