Skip to content

Commit 6328f8f

Browse files
committed
higher character count limits
1 parent cfd12e7 commit 6328f8f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

client/src/components/AdminView.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ interface PollFormInputs {
2626
*/
2727
export const AdminView = () => {
2828
const dispatch = useContext(GlobalDispatchContext);
29+
const pollOptionMaxTextLength = 100;
30+
const pollQuestionMaxTextLength = 150;
2931

3032
const [showConfirmationModal, setShowConfirmationModal] = useState(false);
3133
const [pendingAction, setPendingAction] = useState<null | (() => void)>(null);
@@ -154,9 +156,11 @@ export const AdminView = () => {
154156
name="question"
155157
value={formData.question}
156158
onChange={handleChange}
157-
maxLength={150}
159+
maxLength={pollQuestionMaxTextLength}
158160
/>
159-
<span className="input-char-count">{formData.question.length}/150</span>
161+
<span className="input-char-count">
162+
{formData.question.length}/{pollQuestionMaxTextLength}
163+
</span>
160164
</div>
161165

162166
{["answer1", "answer2", "answer3", "answer4", "answer5"].map((field, index) => (
@@ -168,9 +172,11 @@ export const AdminView = () => {
168172
name={field}
169173
value={formData[field as keyof PollFormInputs]}
170174
onChange={handleChange}
171-
maxLength={16}
175+
maxLength={pollOptionMaxTextLength}
172176
/>
173-
<span className="input-char-count">{formData[field as keyof PollFormInputs].length}/16</span>
177+
<span className="input-char-count">
178+
{formData[field as keyof PollFormInputs].length}/{pollOptionMaxTextLength}
179+
</span>
174180
</div>
175181
))}
176182

client/src/pages/Home.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ const Home = () => {
108108
key={i}
109109
disabled={areButtonsDisabled}
110110
onClick={() => handleVote(i)}
111-
className={isSelected ? "btn" : "btn btn-outline"}
111+
className={`${isSelected ? "btn" : "btn btn-outline"} inline-block w-auto max-w-none break-words`}
112+
style={{ height: "auto", maxHeight: "none" }}
112113
>
113-
<div className="flex flex-auto items-stretch">
114-
<div className="grow text-left">{ans}</div>
114+
<div className="flex items-center">
115+
<div className="text-left mr-2">{ans}</div>
115116
<div className={isSelected ? "text-sm text-white" : "p2"}>
116117
{isAdmin || selectedOption !== null ? voteText : ""}
117118
</div>

0 commit comments

Comments
 (0)