Skip to content

Commit

Permalink
fixed less issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducica committed Feb 17, 2024
1 parent 3d2f033 commit e7fc24c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const CountElement = ({ totalResults }) => {
};

export const ResultCount = ({ currentResultsState = {} }) => {
const { total } = currentResultsState.data;
const total = currentResultsState?.data?.total;
const { loading } = currentResultsState;
// determine if we are in searchApp context or pure searchkit
const searchAppContext = useContext(SearchConfigurationContext);
Expand All @@ -34,5 +34,7 @@ export const ResultCount = ({ currentResultsState = {} }) => {
CountElement.propTypes = {
totalResults: PropTypes.number.isRequired,
};

ResultCount.propTypes = {
currentResultsState: PropTypes.object,
};
export const ResultCountWithState = withState(ResultCount);
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export const SearchappSearchbarElement = withState(
currentQueryState,
iconName,
iconColor,
placeholderText,
placeholder: passedPlaceholder,
}) => {
const placeholder = passedPlaceholder || i18next.t("Search");

const onSearch = () => {
updateQueryState({ ...currentQueryState, queryString });
};
Expand All @@ -36,8 +38,8 @@ export const SearchappSearchbarElement = withState(
"aria-label": i18next.t("Search"),
}}
fluid
placeholder={placeholderText}
aria-label={placeholderText}
placeholder={placeholder}
aria-label={placeholder}
onChange={(event, { value }) => {
onInputChange(value);
}}
Expand All @@ -49,7 +51,7 @@ export const SearchappSearchbarElement = withState(
);

SearchappSearchbarElement.propTypes = {
placeholderText: PropTypes.string,
placeholder: PropTypes.string,
queryString: PropTypes.string,
onInputChange: PropTypes.func,
updateQueryState: PropTypes.func,
Expand All @@ -59,7 +61,7 @@ SearchappSearchbarElement.propTypes = {
};

SearchappSearchbarElement.defaultProps = {
placeholderText: i18next.t("Search"),
placeholder: i18next.t("Search"),
iconName: "search",
iconColor: "green",
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
*/
& {
@import "./definitions/datepicker";
}

& {
@import "./definitions/page_header";
}

& {
@import "./definitions/page_footer";
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
@pageHeaderMinHeight: 6rem;
@pageHeaderLogoHeight:@pageHeaderMinHeight - 2rem;
@borderRadius: 0.3rem;
@pageheaderbottomborder:1px solid black;
@pageHeaderBottomBorder:1px solid black;

0 comments on commit e7fc24c

Please sign in to comment.