Skip to content

Commit

Permalink
modified dropdown option labels (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swathi-eGov authored May 10, 2024
1 parent 7b6015a commit 7574d99
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion react/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "webpack --mode production"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.1-beta.17",
"@egovernments/digit-ui-components": "0.0.1-beta.18",
"@egovernments/digit-ui-libraries": "1.8.2-beta.1",
"@egovernments/digit-ui-module-common": "1.7.10",
"@egovernments/digit-ui-module-core": "1.8.1-beta.6",
Expand Down
2 changes: 1 addition & 1 deletion react/example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> -->
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> -->
<!-- <script src="%REACT_APP_GLOBAL%"></script> -->
<script src="%REACT_APP_GLOBAL%"></script>

</head>

Expand Down
2 changes: 1 addition & 1 deletion react/modules/Project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"@egovernments/digit-ui-components": "0.0.1-beta.17",
"@egovernments/digit-ui-components": "0.0.1-beta.18",
"lodash": "^4.17.21",
"react": "17.0.2",
"react-date-range": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.1-beta.17",
"@egovernments/digit-ui-components": "0.0.1-beta.18",
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"@egovernments/digit-ui-components": "0.0.1-beta.17",
"@egovernments/digit-ui-components": "0.0.1-beta.18",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@egovernments/digit-ui-module-sample": "0.0.1",
"@egovernments/digit-ui-react-components": "1.7.10",
"@egovernments/digit-ui-svg-components": "1.0.4",
"@egovernments/digit-ui-components": "0.0.1-beta.17",
"@egovernments/digit-ui-components": "0.0.1-beta.18",
"babel-loader": "8.1.0",
"clean-webpack-plugin": "4.0.0",
"css-loader": "5.2.6",
Expand Down
1 change: 1 addition & 0 deletions react/ui-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ yarn storybook
# Changelog

```bash
0.0.1-beta.18 updated dropdown option labels
0.0.1-beta.17 updated toast info varinat css and category option css
0.0.1-beta.16 added erroe boundary atom
0.0.1-beta.15 added info varinat for toast
Expand Down
2 changes: 1 addition & 1 deletion react/ui-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-components",
"version": "0.0.1-beta.17",
"version": "0.0.1-beta.18",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
10 changes: 5 additions & 5 deletions react/ui-components/src/atoms/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,16 @@ const Dropdown = (props) => {
{props.isPropertyAssess ? (
<div>
{props.t
? props.t(option[props.optionKey])
: option[props.optionKey]}
? props.t(option[props?.optionKey])
: option[props?.optionKey]}
</div>
) : (
<span
className={`main-option ${props.variant ? props?.variant : ""}`}
>
{props.t
? props.t(option[props.optionKey])
: option[props.optionKey]}
? props.t(option[props?.optionKey])
: option[props?.optionKey]}
</span>
)}
</div>
Expand Down Expand Up @@ -352,7 +352,7 @@ const Dropdown = (props) => {
fill="#505a5f"
/>
)}
{option[props.optionKey]}
{t(option[props?.optionKey])}
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion react/ui-components/src/atoms/MultiSelectDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ const MultiSelectDropdown = ({
addSelectAllCheck ? "selectAll" : ""
}`}
>
<div className="digit-category-name">{option[optionsKey]}</div>
<div className="digit-category-name">{t(option[optionsKey])}</div>
{addCategorySelectAllCheck && (
<div
className="digit-category-selectAll"
Expand Down
7 changes: 5 additions & 2 deletions react/ui-components/src/atoms/TreeSelect.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { useState, useEffect } from "react";
import { SVG } from "./SVG";
import { useTranslation } from "react-i18next";

const TreeSelectOption = ({ option, onSelect, isSelected, renderOptions, level = 0,optionsKey }) => {
const [isExpanded, setExpanded] = useState(false);
const { t } = useTranslation();
const handleToggleDropdown = () => {
if (option.options) {
setExpanded(!isExpanded);
Expand All @@ -29,7 +31,7 @@ const TreeSelectOption = ({ option, onSelect, isSelected, renderOptions, level =
)}
</div>
)}
<div className="digit-option-label">{option[optionsKey]}</div>
<div className="digit-option-label">{t(option[optionsKey])}</div>
</div>
{isExpanded &&
option.options &&
Expand All @@ -40,6 +42,7 @@ const TreeSelectOption = ({ option, onSelect, isSelected, renderOptions, level =
};
const TreeMultiSelect = ({ option, onSelect, isSelected, renderOptions, level = 0, isParentSelected, setParentSelected, optionsKey}) => {
const [isExpanded, setExpanded] = useState(false);
const { t } = useTranslation();
const handleToggleDropdown = () => {
if (option.options) {
setExpanded(!isExpanded);
Expand Down Expand Up @@ -155,7 +158,7 @@ const TreeMultiSelect = ({ option, onSelect, isSelected, renderOptions, level =
<SVG.Check fill={(allChildrenSelected || isSelected(option)) && !isParentSelected ? "#FFFFFF" : "#C84C0E"} />
)}
</div>
<div className="digit-option-label">{option[optionsKey]}</div>
<div className="digit-option-label">{t(option[optionsKey])}</div>
</div>
{isExpanded && option.options && option.options.length > 0 && (
<div className="child-options-container">
Expand Down

0 comments on commit 7574d99

Please sign in to comment.