Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fde5a8b

Browse files
Added translations for FE components
1 parent 402a081 commit fde5a8b

File tree

36 files changed

+307
-248
lines changed

36 files changed

+307
-248
lines changed

‎frontend/src/components/ImageList/ImageList.tsx‎

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,26 @@ interface ImageListProps {
1111
removeImage?: (url: string) => void;
1212
}
1313

14-
const ImageList: FC<ImageListProps> = ({ images, removeImage }): ReactElement => {
14+
const ImageList: FC<ImageListProps> = ({ images, removeImage }): ReactElement |null=> {
1515
const classes = useImageListStyles();
1616

17+
if (images.length === 0) {
18+
return null;
19+
}
20+
1721
return (
18-
<>
19-
{(images.length !== 0) &&
20-
<div className={classes.container}>
21-
{images.map((image, index) => (
22-
<div key={index} className={classes.item}>
23-
{removeImage && (
24-
<IconButton
25-
className={classes.itemRemove}
26-
onClick={(): void => removeImage(image.src)}
27-
>
28-
<ClearIcon style={{ fontSize: 15 }} />
29-
</IconButton>
30-
)}
31-
<img key={image.src} src={image.src} />
32-
</div>
33-
))}
22+
<div className={classes.container}>
23+
{images.map((image, index) => (
24+
<div key={index} className={classes.item}>
25+
{removeImage && (
26+
<IconButton className={classes.itemRemove} onClick={(): void => removeImage(image.src)}>
27+
<ClearIcon style={{ fontSize: 15 }} />
28+
</IconButton>
29+
)}
30+
<img key={image.src} src={image.src} />
3431
</div>
35-
}
36-
</>
32+
))}
33+
</div>
3734
);
3835
};
3936

‎frontend/src/components/LargeLinkPreview/LargeLinkPreview.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ const LargeLinkPreview: FC<LargeLinkPreviewProps> = (
3030
<div className={classes.container}>
3131
<img className={classes.linkCover} src={linkCover} alt={linkCover} />
3232
<div className={classes.siteInfoWrapper}>
33-
<Typography variant={"body1"} component={"div"}>
33+
<Typography variant="body1" component="div">
3434
{linkTitle}
3535
</Typography>
36-
<Typography variant={"subtitle1"} component={"div"}>
36+
<Typography variant="subtitle1" component="div">
3737
{linkDescription}
3838
</Typography>
39-
<Typography variant={"subtitle1"} component={"div"}>
39+
<Typography variant="subtitle1" component="div">
4040
{LinkIcon}{domain}
4141
</Typography>
4242
</div>

‎frontend/src/components/LinkWrapper/LinkWrapper.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ interface LinkWrapperProps {
1212
const LinkWrapper: FC<LinkWrapperProps> = ({ children, path, visiblePopperWindow }): ReactElement => {
1313
const globalClasses = useGlobalStyles({});
1414

15-
if (visiblePopperWindow) {
16-
return <span>{children}</span>;
17-
} else {
18-
return (
19-
<Link to={path} className={globalClasses.link}>
20-
{children}
21-
</Link>
22-
);
23-
}
15+
return visiblePopperWindow
16+
? <span>{children}</span>
17+
: <Link to={path} className={globalClasses.link}>{children}</Link>;
2418
};
2519

2620
export default LinkWrapper;

‎frontend/src/components/ListsModal/ListsModalItem/ListsModalItem.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ const ListsModalItem: FC<ListsModalItemProps> = memo(({ list }): ReactElement =>
1717
return (
1818
<>
1919
<Avatar variant="square" className={classes.listAvatar} src={wallpaper} />
20-
<Typography component={"span"}>
20+
<Typography component="span">
2121
{list.listName}
2222
</Typography>
2323
{list?.isPrivate && <LockIcon />}
24-
{list.isMemberInList && <span id={"check"}>{CheckIcon}</span>}
24+
{list.isMemberInList && <span id="check">{CheckIcon}</span>}
2525
</>
2626
);
2727
});

‎frontend/src/components/PageHeaderTitle/PageHeaderTitle.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ interface PageHeaderTitleProps {
99
const PageHeaderTitle: FC<PageHeaderTitleProps> = ({ title, subtitle }): ReactElement => {
1010
return (
1111
<div>
12-
<Typography variant={"h5"} component={"div"}>
12+
<Typography variant="h5" component="div">
1313
{title}
1414
</Typography>
15-
<Typography variant={"subtitle2"} component={"div"}>
15+
<Typography variant="subtitle2" component="div">
1616
{subtitle}
1717
</Typography>
1818
</div>

‎frontend/src/components/PopperUserWindow/PopperFooter/PopperFooter.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const PopperFooter = memo((): ReactElement => {
2222

2323
return (
2424
<>
25-
<Typography variant={"body1"} component={"div"} className={classes.userInfo}>{about}</Typography>
25+
<Typography variant="body1" component="div" className={classes.userInfo}>{about}</Typography>
2626
<div className={classes.userFollowersWrapper}>
2727
<PopperFooterFollowing />
2828
<PopperFooterFollowers />

‎frontend/src/components/PopperUserWindow/PopperFooter/PopperFooterFollowers.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { memo, ReactElement } from "react";
22
import { Link } from "react-router-dom";
33
import { useSelector } from "react-redux";
44
import { Typography } from "@material-ui/core";
5+
import { useTranslation } from "react-i18next";
56

67
import { USER } from "../../../constants/path-constants";
78
import { selectUserDetailFollowingCount, selectUserDetailId } from "../../../store/ducks/userDetail/selectors";
@@ -11,11 +12,16 @@ const PopperFooterFollowers = memo((): ReactElement => {
1112
const classes = usePopperFooterStyles();
1213
const userId = useSelector(selectUserDetailId);
1314
const followingSize = useSelector(selectUserDetailFollowingCount);
15+
const { t } = useTranslation();
1416

1517
return (
1618
<Link to={`${USER}/${userId}/followers`} className={classes.followLink}>
17-
<Typography variant={"h6"} component={"span"}>{followingSize}</Typography>
18-
<Typography variant={"subtitle1"} component={"span"}>Followers</Typography>
19+
<Typography variant="h6" component="span">
20+
{followingSize}
21+
</Typography>
22+
<Typography variant="subtitle1" component="span">
23+
{t("FOLLOWERS", { defaultValue: "Followers" })}
24+
</Typography>
1925
</Link>
2026
);
2127
});

‎frontend/src/components/PopperUserWindow/PopperFooter/PopperFooterFollowing.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { memo, ReactElement } from "react";
22
import { Link } from "react-router-dom";
33
import { useSelector } from "react-redux";
44
import { Typography } from "@material-ui/core";
5+
import { useTranslation } from "react-i18next";
56

67
import { USER } from "../../../constants/path-constants";
78
import { selectUserDetailFollowersCount, selectUserDetailId } from "../../../store/ducks/userDetail/selectors";
@@ -11,11 +12,16 @@ const PopperFooterFollowing = memo((): ReactElement => {
1112
const classes = usePopperFooterStyles();
1213
const userId = useSelector(selectUserDetailId);
1314
const followersSize = useSelector(selectUserDetailFollowersCount);
15+
const { t } = useTranslation();
1416

1517
return (
1618
<Link to={`${USER}/${userId}/following`} className={classes.followLink}>
17-
<Typography variant={"h6"} component={"span"}>{followersSize}</Typography>
18-
<Typography variant={"subtitle1"} component={"span"}>Following</Typography>
19+
<Typography variant="h6" component="span">
20+
{followersSize}
21+
</Typography>
22+
<Typography variant="subtitle1" component="span">
23+
{t("FOLLOWING", { defaultValue: "Following" })}
24+
</Typography>
1925
</Link>
2026
);
2127
});

‎frontend/src/components/PopperUserWindow/PopperInfo/PopperInfo.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const PopperInfo = memo((): ReactElement => {
2424
<div className={classes.userInfoWrapper}>
2525
<Link to={`${PROFILE}/${userId}`}>
2626
<div>
27-
<Typography variant={"h6"} component={"span"}>{fullName}</Typography>
27+
<Typography variant="h6" component="span">{fullName}</Typography>
2828
{isPrivateProfile && <span className={classes.lockIcon}>{LockIcon}</span>}
2929
</div>
3030
</Link>
31-
<Typography variant={"subtitle1"} component={"div"}>@{username}</Typography>
31+
<Typography variant="subtitle1" component="div">@{username}</Typography>
3232
</div>
3333
);
3434
});

‎frontend/src/components/ProfileImages/__tests__/ProfileImages.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { createMockRootState, mountWithStore } from "../../../util/test-utils/te
77
import { MODAL } from "../../../constants/path-constants";
88
import ProfileImages from "../ProfileImages";
99
import { LoadingStatus } from "../../../types/common";
10+
import { TweetImageResponse } from "../../../types/tweet";
1011

1112
describe("ProfileImages", () => {
1213
const mockState = createMockRootState(LoadingStatus.LOADED);
@@ -103,7 +104,7 @@ describe("ProfileImages", () => {
103104
};
104105

105106
const createImagesArray = (arrayLength: number) => {
106-
const imagesArray = [];
107+
const imagesArray: TweetImageResponse[] = [];
107108

108109
for (let i = 0; i < arrayLength; i++) {
109110
imagesArray.push({

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /