Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
arminmeh committed Jul 5, 2024
1 parent f6135b7 commit 274b9cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions docs/data/data-grid/custom-columns/CustomColumnFullExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const RatingValue = React.memo(function RatingValue(props) {
);
});

const EditRating = (props) => {
function EditRating(props) {
const { id, value, field } = props;

const apiRef = useGridApiContext();
Expand Down Expand Up @@ -145,7 +145,7 @@ const EditRating = (props) => {
{Number(value)}
</Box>
);
};
}

const Country = React.memo(function Country(props) {
const { value } = props;
Expand Down Expand Up @@ -190,7 +190,7 @@ const StyledAutocomplete = styled(Autocomplete)(({ theme }) => ({
},
}));

const EditCountry = (props) => {
function EditCountry(props) {
const { id, value, field } = props;

const apiRef = useGridApiContext();
Expand Down Expand Up @@ -248,7 +248,7 @@ const EditCountry = (props) => {
)}
/>
);
};
}

const Center = styled('div')({
height: '100%',
Expand Down Expand Up @@ -341,17 +341,17 @@ const StyledSlider = styled(Slider)(({ theme }) => ({
},
}));

const ValueLabelComponent = (props) => {
const ValueLabelComponent = React.memo(function ValueLabelComponent(props) {
const { children, open, value } = props;

return (
<Tooltip open={open} enterTouchDelay={0} placement="top" title={value}>
{children}
</Tooltip>
);
};
});

const EditProgress = (props) => {
function EditProgress(props) {
const { id, value, field } = props;
const [valueState, setValueState] = React.useState(Number(value));

Expand Down Expand Up @@ -403,7 +403,7 @@ const EditProgress = (props) => {
valueLabelFormat={(newValue) => `${(newValue * 100).toLocaleString()} %`}
/>
);
};
}

const StyledChip = styled(Chip)(({ theme }) => ({
justifyContent: 'left',
Expand Down Expand Up @@ -458,7 +458,7 @@ const Status = React.memo((props) => {
);
});

const EditStatus = (props) => {
function EditStatus(props) {
const { id, value, field } = props;
const rootProps = useGridRootProps();
const apiRef = useGridApiContext();
Expand Down Expand Up @@ -528,7 +528,7 @@ const EditStatus = (props) => {
})}
</Select>
);
};
}

const Incoterm = React.memo(function Incoterm(props) {
const { value } = props;
Expand All @@ -553,7 +553,7 @@ const Incoterm = React.memo(function Incoterm(props) {
);
});

const EditIncoterm = (props) => {
function EditIncoterm(props) {
const { id, value, field } = props;

const apiRef = useGridApiContext();
Expand Down Expand Up @@ -604,7 +604,7 @@ const EditIncoterm = (props) => {
})}
</Select>
);
};
}

/** Custom cell renderers */
// Avatar
Expand Down
24 changes: 12 additions & 12 deletions docs/data/data-grid/custom-columns/CustomColumnFullExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const RatingValue = React.memo(function RatingValue(props: RatingValueProps) {
);
});

const EditRating = (props: GridRenderEditCellParams<any, number>) => {
function EditRating(props: GridRenderEditCellParams<any, number>) {
const { id, value, field } = props;

const apiRef = useGridApiContext();
Expand Down Expand Up @@ -179,7 +179,7 @@ const EditRating = (props: GridRenderEditCellParams<any, number>) => {
{Number(value)}
</Box>
);
};
}

const Country = React.memo(function Country(props: CountryProps) {
const { value } = props;
Expand Down Expand Up @@ -224,7 +224,7 @@ const StyledAutocomplete = styled(Autocomplete)(({ theme }) => ({
},
})) as typeof Autocomplete;

const EditCountry = (props: GridRenderEditCellParams<CountryIsoOption>) => {
function EditCountry(props: GridRenderEditCellParams<CountryIsoOption>) {
const { id, value, field } = props;

const apiRef = useGridApiContext();
Expand Down Expand Up @@ -284,7 +284,7 @@ const EditCountry = (props: GridRenderEditCellParams<CountryIsoOption>) => {
)}
/>
);
};
}

const Center = styled('div')({
height: '100%',
Expand Down Expand Up @@ -377,17 +377,17 @@ const StyledSlider = styled(Slider)(({ theme }) => ({
},
}));

const ValueLabelComponent = (props: any) => {
const ValueLabelComponent = React.memo(function ValueLabelComponent(props: any) {
const { children, open, value } = props;

return (
<Tooltip open={open} enterTouchDelay={0} placement="top" title={value}>
{children}
</Tooltip>
);
};
});

const EditProgress = (props: GridRenderEditCellParams<any, number>) => {
function EditProgress(props: GridRenderEditCellParams<any, number>) {
const { id, value, field } = props;
const [valueState, setValueState] = React.useState(Number(value));

Expand Down Expand Up @@ -439,7 +439,7 @@ const EditProgress = (props: GridRenderEditCellParams<any, number>) => {
valueLabelFormat={(newValue) => `${(newValue * 100).toLocaleString()} %`}
/>
);
};
}

const StyledChip = styled(Chip)(({ theme }) => ({
justifyContent: 'left',
Expand Down Expand Up @@ -494,7 +494,7 @@ const Status = React.memo((props: StatusProps) => {
);
});

const EditStatus = (props: GridRenderEditCellParams<any, string>) => {
function EditStatus(props: GridRenderEditCellParams<any, string>) {
const { id, value, field } = props;
const rootProps = useGridRootProps();
const apiRef = useGridApiContext();
Expand Down Expand Up @@ -564,7 +564,7 @@ const EditStatus = (props: GridRenderEditCellParams<any, string>) => {
})}
</Select>
);
};
}

const Incoterm = React.memo(function Incoterm(props: IncotermProps) {
const { value } = props;
Expand All @@ -589,7 +589,7 @@ const Incoterm = React.memo(function Incoterm(props: IncotermProps) {
);
});

const EditIncoterm = (props: GridRenderEditCellParams<any, string | null>) => {
function EditIncoterm(props: GridRenderEditCellParams<any, string | null>) {
const { id, value, field } = props;

const apiRef = useGridApiContext();
Expand Down Expand Up @@ -640,7 +640,7 @@ const EditIncoterm = (props: GridRenderEditCellParams<any, string | null>) => {
})}
</Select>
);
};
}

/** Custom cell renderers */
// Avatar
Expand Down

0 comments on commit 274b9cc

Please sign in to comment.