fetch latest version tag from docker hub (#11362)

closes #11352

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
nitin
2025-04-08 14:25:03 +05:30
committed by GitHub
parent 95eba07f6e
commit ea93ac6348
11 changed files with 273 additions and 77 deletions
@@ -0,0 +1,53 @@
import styled from '@emotion/styled';
import { t } from '@lingui/core/macro';
type SettingsAdminVersionDisplayProps = {
version: string | undefined | null;
loading: boolean;
noVersionMessage: string;
};
const StyledActionLink = styled.a`
align-items: center;
color: ${({ theme }) => theme.font.color.primary};
display: flex;
font-size: ${({ theme }) => theme.font.size.sm};
font-weight: ${({ theme }) => theme.font.weight.regular};
gap: ${({ theme }) => theme.spacing(1)};
text-decoration: none;
:hover {
color: ${({ theme }) => theme.font.color.primary};
cursor: pointer;
}
`;
const StyledSpan = styled.span`
color: ${({ theme }) => theme.font.color.primary};
font-size: ${({ theme }) => theme.font.size.sm};
font-weight: ${({ theme }) => theme.font.weight.regular};
`;
export const SettingsAdminVersionDisplay = ({
version,
loading,
noVersionMessage,
}: SettingsAdminVersionDisplayProps) => {
if (loading) {
return <StyledSpan>{t`Loading...`}</StyledSpan>;
}
if (!version) {
return <StyledSpan>{noVersionMessage}</StyledSpan>;
}
return (
<StyledActionLink
href={`https://hub.docker.com/r/twentycrm/twenty/tags?name=${version}`}
target="_blank"
rel="noreferrer"
>
{version}
</StyledActionLink>
);
};