Skip to content

Commit

Permalink
Fix padding for different translations in the menu items.
Browse files Browse the repository at this point in the history
Signed-off-by: Aliwoto <aminnimaj@gmail.com>
  • Loading branch information
ALiwoto committed Feb 3, 2025
1 parent 1cbe964 commit 4a9379a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/menus/menuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const MenuItemChildren = styled.div<{ $isOpen: boolean }>`
`;

const ChildItem = styled.div`
padding: 5px 0 5px 20px;
padding: 5px ${CurrentAppTranslation.rightPaddingValue} 5px ${CurrentAppTranslation.leftPaddingValue};
`;

interface MenuItemProps {
Expand Down
1 change: 1 addition & 0 deletions src/pages/createExamPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const CreateExamPage: React.FC = () => {
data: createExamData,
handleInputChange,
isEditing: true,
excludedFields: ['is_sample_exam'],
})}
<SubmitButton type="submit">
{CurrentAppTranslation.CreateButtonText}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/examHallPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ExamHallPage: React.FC = () => {
setIsLoading(true);
try {
const result = await apiClient.getExamInfo(examId!);
if (result.is_strict) {
if (result.is_strict && !result.can_edit_question) {
QuestionsListLimit = 1;
}
setExamInfo(result);
Expand Down
2 changes: 2 additions & 0 deletions src/pages/searchExamPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const SearchExamPage = () => {
const providedQuery = urlSearch.get('query');
const providedPage = urlSearch.get('page');
const forEdit = (urlSearch.get('edit') ?? "false") === "true";
const isSampleExam = urlSearch.get('sample') === 'true' || urlSearch.get('sample') === '1';

const [query, setQuery] = useState(providedQuery ?? '');
const [courses, setCourses] = useState<SearchedExamInfo[]>([]);
Expand All @@ -114,6 +115,7 @@ const SearchExamPage = () => {
search_query: query,
offset: newPage * PageLimit,
limit: PageLimit,
sample_exams: isSampleExam,
})

if (!results || !results.exams) {
Expand Down
2 changes: 2 additions & 0 deletions src/translations/appTranslation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export class AppTranslationBase {
justifyContent: TextJustifyContent = "flex-start";
textAlign: string = "left";
float: string = "left";
leftPaddingValue: string = "20px";
rightPaddingValue: string = "0";

//#endregion

Expand Down
2 changes: 2 additions & 0 deletions src/translations/faTranslation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class FaTranslation extends AppTranslationBase {
justifyContent: TextJustifyContent = "flex-end";
textAlign: string = "right";
float: string = "right";
leftPaddingValue: string = "0";
rightPaddingValue: string = "20px";

//#endregion

Expand Down

0 comments on commit 4a9379a

Please sign in to comment.