Skip to content

Commit

Permalink
fix: scroll table
Browse files Browse the repository at this point in the history
  • Loading branch information
IanKrieger committed Aug 28, 2023
1 parent 46eeb37 commit 75a33e5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/Drawer/MiniSideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type RouteOption = {
onClick?: (event: MouseEvent<any>) => void;
};

const drawerWidth = 120;
const drawerWidth = 110;
export default function MiniSideBar({ children }: PropsWithChildren) {
const dashboardRoutes: RouteOption[] = [
{
Expand Down Expand Up @@ -151,8 +151,8 @@ const ItemBox = (props: RouteOption) => {
borderRadius: "0px",
gap: "3px",
visibility: props.disabled ? "hidden" : "visible",
paddingLeft: "5px",
paddingRight: "5px",
paddingLeft: "3px",
paddingRight: "3px",
}}
selected={match.url.includes(props.href)}
onClick={props.onClick}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Switch/OnOff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ export function OnOff({ state, loading, end, onChange, type, source }: Props) {
setChecked(e.target.checked);
onChange(theState);
}}
sx={{ p: 0 }}
checked={checked}
disabled={loading}
/>
) : (
<Typography sx={{ textAlign: "center" }}>-</Typography>
<Typography sx={{ textAlign: "center", p: 0 }}>-</Typography>
)}
</span>
</Tooltip>
Expand Down
10 changes: 7 additions & 3 deletions src/user/campaignList/CampaignList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function CampaignList({
selectedCampaigns,
onCampaignSelect,
}: Props) {
let initialSort = 11;
const [engagementData, setEngagementData] =
useState<Map<string, EngagementOverview>>();

Expand All @@ -60,7 +61,7 @@ export function CampaignList({
...r,
advertiserId: advertiser?.id ?? "",
}),
sx: { width: "1px" },
sx: { width: "1px", p: 0 },
sortable: false,
},
{
Expand All @@ -86,7 +87,7 @@ export function CampaignList({
extendedRenderer: (r) => (
<Status state={r.state} start={r.startAt} end={r.endAt} />
),
sx: { width: "10px" },
sx: { width: "1px", p: 0 },
},
{
title: "Budget",
Expand Down Expand Up @@ -143,6 +144,7 @@ export function CampaignList({
];

if (advertiser?.selfServiceCreate && advertiser.selfServiceEdit) {
initialSort += 1;
columns.unshift({
title: "",
value: (c) => c.id,
Expand All @@ -155,13 +157,14 @@ export function CampaignList({
/>
),
align: "center",
sx: { width: "1px" },
});
}

return (
<EnhancedTable
rows={advertiser?.campaigns ?? []}
initialSortColumn={9}
initialSortColumn={initialSort}
initialSortDirection="desc"
columns={columns}
/>
Expand All @@ -182,6 +185,7 @@ const CampaignCheckBox = (props: CheckBoxProps) => {
<Checkbox
disabled={props.selectedCampaigns.length === 1 && !campaignSelected}
size="small"
sx={{ p: 0 }}
checked={campaignSelected}
onChange={(e) =>
props.onCampaignSelect(props.campaign.id, e.target.checked)
Expand Down
1 change: 1 addition & 0 deletions src/user/views/user/CampaignView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export function CampaignView() {
sx={{
flexGrow: 1,
mr: 2,
overflowX: "auto",
}}
additionalAction={<CampaignAgeFilter disabled={loading} />}
>
Expand Down

0 comments on commit 75a33e5

Please sign in to comment.