Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit d7ba51a

Browse files
committed
fix: React and sass warnings
1 parent 59405fa commit d7ba51a

4 files changed

Lines changed: 11 additions & 22 deletions

File tree

apps/admin-ui/src/styles/global.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import "font";
2-
@import "variables";
1+
@use "font";
2+
@use "variables";
33

44
a {
55
text-underline-offset: 2px;

apps/ui/styles/global.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import "font";
2-
@import "variables";
1+
@use "font";
2+
@use "variables";
33

44
/* TODO is this correct? if it's it should be in common/styles/global.scss */
55
a {

packages/common/src/components/Card.tsx

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -376,19 +376,9 @@ function Texts({
376376
);
377377
}
378378

379-
const addKey = (Component: JSX.Element, key: number): JSX.Element => {
380-
return React.cloneElement(Component, {
381-
key: Component.props.key ?? key,
382-
});
383-
};
384-
385379
function Tags({ tags }: Readonly<{ tags?: JSX.Element[] }>) {
386380
if (!tags) return null;
387-
return (
388-
<TagContainer data-test-id="card__tags">
389-
{tags.map((tag, i) => addKey(tag, i))}
390-
</TagContainer>
391-
);
381+
return <TagContainer data-test-id="card__tags">{tags}</TagContainer>;
392382
}
393383

394384
const InfoItem = styled(Flex).attrs({
@@ -407,13 +397,13 @@ function Infos({
407397
}>) {
408398
if (!infos) return null;
409399
return (
410-
<InfoContainer data-testId="data-testId">
400+
<InfoContainer>
411401
{infos.map((info) => (
412402
<Info
413403
key={info.value}
414404
value={info.value}
415405
icon={info.icon}
416-
data-test-id={info.testId}
406+
data-testid={info.testId}
417407
/>
418408
))}
419409
</InfoContainer>
@@ -423,9 +413,10 @@ function Infos({
423413
function Info({
424414
value,
425415
icon,
416+
...rest
426417
}: Readonly<{ value: string; icon?: JSX.Element }>) {
427418
return (
428-
<InfoItem>
419+
<InfoItem {...rest}>
429420
{icon}
430421
<span>{value}</span>
431422
</InfoItem>
@@ -434,7 +425,5 @@ function Info({
434425

435426
function Buttons({ buttons }: Readonly<{ buttons?: JSX.Element[] }>) {
436427
if (!buttons) return null;
437-
return (
438-
<ButtonContainer>{buttons.map((btn, i) => addKey(btn, i))}</ButtonContainer>
439-
);
428+
return <ButtonContainer>{buttons}</ButtonContainer>;
440429
}

packages/common/styles/global.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "variables";
1+
@use "variables";
22

33
/* hack to deal with iPhone user agent overriding inherited colours with apple-system-blue */
44
input:is([type="button"], [type="submit"], [type="reset"]),

0 commit comments

Comments
 (0)