1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Resolves #7934: Add Simple Backup as a default plugin (#9360)

This commit is contained in:
Henry Heino
2023-12-11 05:58:45 -08:00
committed by GitHub
parent 6306a0f371
commit 4fc786cf0b
42 changed files with 754 additions and 378 deletions

View File

@ -60,7 +60,7 @@ const CellRoot = styled.div<{ isCompatible: boolean }>`
box-sizing: border-box;
background-color: ${props => props.theme.backgroundColor};
flex-direction: column;
align-items: flex-start;
align-items: stretch;
padding: 15px;
border: 1px solid ${props => props.theme.dividerColor};
border-radius: 6px;
@ -96,12 +96,15 @@ const NeedUpgradeMessage = styled.span`
font-size: ${props => props.theme.fontSize}px;
`;
const DevModeLabel = styled.div`
const BoxedLabel = styled.div`
border: 1px solid ${props => props.theme.color};
border-radius: 4px;
padding: 4px 6px;
font-size: ${props => props.theme.fontSize * 0.75}px;
color: ${props => props.theme.color};
flex-grow: 0;
height: min-content;
margin-top: auto;
`;
const StyledNameAndVersion = styled.div<{ mb: any }>`
@ -170,7 +173,7 @@ export default function(props: Props) {
if (!props.onToggle) return null;
if (item.devMode) {
return <DevModeLabel>DEV</DevModeLabel>;
return <BoxedLabel>DEV</BoxedLabel>;
}
return <ToggleButton
@ -217,6 +220,17 @@ export default function(props: Props) {
/>;
}
const renderDefaultPluginLabel = () => {
// Built-in plugins can only be disabled
if (item.manifest._built_in) {
return (
<BoxedLabel>{_('Built in')}</BoxedLabel>
);
}
return null;
};
function renderFooter() {
if (item.devMode) return null;
@ -236,6 +250,7 @@ export default function(props: Props) {
{renderInstallButton()}
{renderUpdateButton()}
<div style={{ display: 'flex', flex: 1 }}/>
{renderDefaultPluginLabel()}
</CellFooter>
);
}