Skip to content

Commit

Permalink
feat: wrap buttons in a fieldset and add an explanatory legend. (#6289)
Browse files Browse the repository at this point in the history
This makes it more obvious to everyone what the buttons do.
  • Loading branch information
thomasheartman committed Feb 21, 2024
1 parent e96f0c2 commit ddae970
Showing 1 changed file with 33 additions and 16 deletions.
Expand Up @@ -40,7 +40,16 @@ const EnvironmentSelectionContainer = styled('div')(({ theme }) => ({
outlineOffset: theme.spacing(0.5),
},

input: {
fieldset: {
border: 'none',
padding: 0,
margin: 0,
},
legend: {
marginBlockEnd: theme.spacing(3),
},

'.visually-hidden': {
border: 0,
clip: 'rect(0 0 0 0)',
height: 'auto',
Expand Down Expand Up @@ -99,21 +108,29 @@ export const ConnectedInstances = () => {
return (
<Container>
<EnvironmentSelectionContainer>
{allEnvironmentsSorted.map((env) => {
return (
<label key={env}>
{env}
<input
defaultChecked={currentEnvironment === env}
type='radio'
name='active-environment'
onClick={() => {
setCurrentEnvironment(env);
}}
/>
</label>
);
})}
<fieldset>
<legend>
Select which environment to display data for. Only
environments that have received traffic for this
application will be shown here.
</legend>
{allEnvironmentsSorted.map((env) => {
return (
<label key={env}>
{env}
<input
defaultChecked={currentEnvironment === env}
className='visually-hidden'
type='radio'
name='active-environment'
onClick={() => {
setCurrentEnvironment(env);
}}
/>
</label>
);
})}
</fieldset>
</EnvironmentSelectionContainer>
<ConnectedInstancesTable
loading={false}
Expand Down

0 comments on commit ddae970

Please sign in to comment.