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

(refactor) Use classnames to apply multiple classes #69

Merged
merged 1 commit into from
Nov 15, 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
},
"packageManager": "[email protected]",
"dependencies": {
"classnames": "^2.3.2",
"dotenv": "^16.3.1"
}
}
19 changes: 12 additions & 7 deletions src/cohort-builder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";

import classNames from "classnames";
import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@carbon/react";
import { showToast, useLayoutType } from "@openmrs/esm-framework";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -169,12 +169,16 @@ const CohortBuilder: React.FC = () => {

return (
<div
className={`omrs-main-content ${styles.mainContainer} ${styles.cohortBuilder}`}
className={classNames(
"omrs-main-content",
styles.mainContainer,
styles.cohortBuilder
)}
>
<div
className={
className={classNames(
isLayoutTablet ? styles.tabletContainer : styles.desktopContainer
}
)}
>
<p className={styles.title}>{t("cohortBuilder", "Cohort Builder")}</p>
<div className={styles.tabContainer}>
Expand All @@ -183,9 +187,10 @@ const CohortBuilder: React.FC = () => {
</p>
<div className={styles.tab}>
<Tabs
className={`${styles.verticalTabs} ${
isLayoutTablet ? styles.tabletTab : styles.desktopTab
}`}
className={classNames(styles.verticalTabs, {
[styles.tabletTab]: isLayoutTablet,
[styles.desktopTab]: !isLayoutTablet,
})}
>
<TabList aria-label="navigation">
{tabs.map((tab: TabItem, index: number) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";

import classNames from "classnames";
import {
DatePicker,
DatePickerInput,
Expand Down Expand Up @@ -84,7 +84,7 @@ const SearchByDemographics: React.FC<SearchByProps> = ({ onSubmit }) => {
return (
<>
<Column>
<p className={`${styles.text} ${styles.genderTitle}`}>
<p className={classNames(styles.text, styles.genderTitle)}>
{t("gender", "Gender")}
</p>
<div className={styles.genderContainer}>
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3042,6 +3042,7 @@ __metadata:
"@types/webpack-env": ^1.18.0
"@typescript-eslint/eslint-plugin": ^5.51.0
"@typescript-eslint/parser": ^5.51.0
classnames: ^2.3.2
concurrently: ^7.6.0
css-loader: ^6.7.3
dayjs: ^1.11.7
Expand Down Expand Up @@ -6217,7 +6218,7 @@ __metadata:
languageName: node
linkType: hard

"classnames@npm:2.3.2":
"classnames@npm:2.3.2, classnames@npm:^2.3.2":
version: 2.3.2
resolution: "classnames@npm:2.3.2"
checksum: 2c62199789618d95545c872787137262e741f9db13328e216b093eea91c85ef2bfb152c1f9e63027204e2559a006a92eb74147d46c800a9f96297ae1d9f96f4e
Expand Down
Loading