Fix layout and pointer hand for expand link

This commit is contained in:
René Pfeuffer
2020-06-10 12:52:13 +02:00
parent 76ee9467df
commit 86282e570f
3 changed files with 101 additions and 69 deletions

View File

@@ -24,6 +24,7 @@
import React, { FC, useState } from "react";
import { useTranslation } from "react-i18next";
import classNames from "classnames";
import styled from "styled-components";
type Props = {
icon: string;
@@ -31,6 +32,10 @@ type Props = {
onClick: () => Promise<any>;
};
const ExpandLink = styled.span`
cursor: pointer;
`;
const HunkExpandLink: FC<Props> = ({ icon, text, onClick }) => {
const [t] = useTranslation("repos");
const [loading, setLoading] = useState(false);
@@ -44,9 +49,9 @@ const HunkExpandLink: FC<Props> = ({ icon, text, onClick }) => {
};
return (
<span onClick={onClickWithLoadingMarker}>
<ExpandLink onClick={onClickWithLoadingMarker}>
<i className={classNames("fa", icon)} /> {loading ? t("diff.expanding") : text}
</span>
</ExpandLink>
);
};