Skip to content

Commit

Permalink
chore(RTL): updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoker committed Oct 31, 2023
1 parent ca76ca2 commit 7863f4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/RTL/RTL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: RTL
id: Right-to-left
section: patterns
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
} from '@patternfly/react-core';

import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
import { capitalize } from '../../../helpers';
import translationsEn from './examples/translations.en.json';
import translationsHe from './examples/translations.he.json';
import AlignRightIcon from '@patternfly/react-icons/dist/esm/icons/align-right-icon';
Expand Down Expand Up @@ -114,6 +113,8 @@ export const PaginatedTableAction = () => {
const [paginatedRows, setPaginatedRows] = React.useState(rows.slice(0, 10));
const [isDirRTL, setIsDirRTL] = React.useState(false);

const capitalize = (input) => input[0].toUpperCase() + input.substring(1);

const switchTranslation = () => {
setIsDirRTL((prevIsDirRTL) => !prevIsDirRTL);
setTranslation((prevTranslation) => (prevTranslation === translationsEn ? translationsHe : translationsEn));
Expand Down

0 comments on commit 7863f4e

Please sign in to comment.