mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 18:26:16 +01:00
Fix layout and pointer hand for expand link
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user