Skip to content

Commit

Permalink
feat: generic improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanoshadjipetrou committed Jul 15, 2024
1 parent 14a8a39 commit 3ac9a45
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/app/components/chart-block/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ export const ChartBlock: React.FC<ChartBlockProps> = (
width: "100%",
marginTop: "20px",
justifyContent: "flex-end",
"> button": {
maxWidth: "unset",
},
},
}}
>
Expand Down
1 change: 1 addition & 0 deletions src/app/components/charts/bar-series/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ echarts.use([
const Tooltip = (props: any) => {
return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "400px",
Expand Down
1 change: 1 addition & 0 deletions src/app/components/charts/bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ echarts.use([
const Tooltip = (props: any) => {
return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "400px",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ echarts.use([
const Tooltip = (props: any) => {
return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "400px",
Expand Down
1 change: 1 addition & 0 deletions src/app/components/charts/line/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ echarts.use([EChartsLine, GridComponent, TooltipComponent, SVGRenderer]);
const Tooltip = (props: any) => {
return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "400px",
Expand Down
1 change: 1 addition & 0 deletions src/app/components/charts/pie/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ echarts.use([EChartsPie, TooltipComponent, SVGRenderer]);
const Tooltip = (props: any) => {
return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "400px",
Expand Down
5 changes: 4 additions & 1 deletion src/app/components/charts/radial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Tooltip = (props: any) => {

return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "400px",
Expand All @@ -47,7 +48,9 @@ const Tooltip = (props: any) => {
<div className="chart-tooltip-text">
{showList
? ""
: `${((props.value / props.totalValue) * 100).toFixed(2).replace(".00", "")}% - `}
: `${((props.value / props.totalValue) * 100)
.toFixed(2)
.replace(".00", "")}% - `}
{formatFinancialValue(props.value)}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/components/charts/sunburst/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ echarts.use([EChartsSunburst, TooltipComponent, SVGRenderer]);
const Tooltip = (props: any) => {
return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "400px",
Expand Down
1 change: 1 addition & 0 deletions src/app/components/charts/treemap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ echarts.use([EchartsTreemap, TooltipComponent, SVGRenderer]);
const Tooltip = (props: any) => {
return (
<div
className="chart-tooltip"
style={{
gap: "10px",
width: "250px",
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const Dropdown: React.FC<DropdownProps> = (props: DropdownProps) => {
"& .MuiPaper-root": {
width: props.width,
"@media (max-width: 767px)": {
width: props.width ?? "160px",
width: props.width ?? "180px",
},
},
}}
Expand Down
5 changes: 5 additions & 0 deletions src/app/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export const Header: React.FC = () => {

const onSearchBtnClick = () => {
setSearchOpen(!searchOpen);
if (!searchOpen)
setTimeout(() => {
const input = document.getElementById("general-search");
if (input) input.focus();
}, 100);
};

const handleKeyPress = (e: KeyboardEvent) => {
Expand Down
6 changes: 4 additions & 2 deletions src/app/components/search/components/results/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ export function SearchResults(props: SearchResultsProps) {
})}
{props.results.length === 0 && !props.loading && hasLoaded && (
<NoResults>
{get(cmsData, "componentsSearch.noResults", "")}
{get(cmsData, "componentsSearch.noResults", "No results found.")}
</NoResults>
)}
{props.loading && (
<NoResults>{get(cmsData, "componentsSearch.loading", "")}</NoResults>
<NoResults>
{get(cmsData, "componentsSearch.loading", "Loading...")}
</NoResults>
)}
</Results>
</Container>
Expand Down
1 change: 1 addition & 0 deletions src/app/components/search/components/results/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const ResultLink = styled(Link)`

export const NoResults = styled.div`
width: 100%;
color: #000;
height: 100%;
display: flex;
align-items: center;
Expand Down
7 changes: 7 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ input[type="text"] {
-webkit-appearance: none;
}


@media (max-width: 767px) {
.chart-tooltip {
width: 250px !important;
}
}

.chart-tooltip-title {
max-width: 100%;
font-size: 18px;
Expand Down

0 comments on commit 3ac9a45

Please sign in to comment.