Skip to content

Commit

Permalink
Adjust buttons style
Browse files Browse the repository at this point in the history
  • Loading branch information
GLDuval committed Apr 1, 2023
1 parent b2ffaa0 commit d00366a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ const Card = styled.div`
background-color: ${({ theme }) => theme.colors.darkerBackground};
border-radius: 4px;
padding: 16px;
margin: 8px;
margin-top: 8px;
margin-right: 8px;
display: flex;
width: 350px;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.5);
`;

const HeaderRow = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ const PresetsContainer = styled.div`
flex-wrap: wrap;
`;

const PresetButtonContainer = styled.div`
display: inline-block;
margin-right: 0.5rem;
`;

const ButtonRow = styled.div`
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
fit-content: fit-content;
width: 100%;
`;

const ArmPresetsConfig = () => {
Expand All @@ -53,7 +54,7 @@ const ArmPresetsConfig = () => {
armPresetsSlice.actions.addPreset({
id: nanoid(),
name: 'New Preset',
positions: jointPositions,
positions: jointPositions.map((value) => round(value, 0)),
})
);
};
Expand Down Expand Up @@ -94,17 +95,22 @@ const ArmPresetsConfig = () => {

<SectionTitle>Presets</SectionTitle>
<ButtonRow>
<Button onClick={addPreset}>
<FaPlus />
<span style={{ marginLeft: '0.2rem' }}>Add Preset</span>
</Button>
{jointPositions.length > 0 && (
<Button onClick={addPresetWithCurrentPositions}>
<PresetButtonContainer>
<Button onClick={addPreset}>
<FaPlus />
<span style={{ marginLeft: '0.2rem' }}>
Add Preset With Current Positions
</span>
<span style={{ marginLeft: '0.2rem' }}>Add Preset</span>
</Button>
</PresetButtonContainer>

{jointPositions.length > 0 && (
<PresetButtonContainer>
<Button onClick={addPresetWithCurrentPositions}>
<FaPlus />
<span style={{ marginLeft: '0.2rem' }}>
Add Preset With Current Positions
</span>
</Button>
</PresetButtonContainer>
)}
</ButtonRow>
<PresetsContainer>
Expand Down

0 comments on commit d00366a

Please sign in to comment.