File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
packages/app/src/app/pages/common/Modals/PreferencesModal
EditorPageSettings/EditorSettings Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ import {
1111} from '../../elements' ;
1212import VSCodePlaceholder from '../../VSCodePlaceholder' ;
1313
14+ const isSafari = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( navigator . userAgent ) ;
15+ const isFF = navigator . userAgent . toLowerCase ( ) . includes ( 'firefox' ) ;
16+
1417function EditorSettings ( { store, signals } ) {
1518 const bindValue = name => ( {
1619 value : store . preferences . settings [ name ] ,
@@ -70,7 +73,8 @@ function EditorSettings({ store, signals }) {
7073 </ VSCodePlaceholder >
7174 </ PreferenceContainer >
7275 </ VSCodePlaceholder >
73- < PreferenceContainer >
76+ { /* {Vim mode does not work on FF or Safari */ }
77+ < PreferenceContainer disabled = { isSafari || isFF } >
7478 < PaddedPreference
7579 title = "VIM Mode"
7680 type = "boolean"
@@ -81,6 +85,15 @@ function EditorSettings({ store, signals }) {
8185 page to see the effects
8286 </ SubDescription >
8387 </ PreferenceContainer >
88+ { isSafari || isFF ? (
89+ < SubDescription
90+ css = { `
91+ margin-top: 0.5rem;
92+ ` }
93+ >
94+ The VIM extension currently only works on Chrome and Microsoft Edge.
95+ </ SubDescription >
96+ ) : null }
8497 </ SubContainer >
8598 </ div >
8699 ) ;
Original file line number Diff line number Diff line change 1- import styled from 'styled-components' ;
1+ import styled , { css } from 'styled-components' ;
22import Preference from '@codesandbox/common/lib/components/Preference' ;
33
44export const SubContainer = styled . div `
@@ -22,6 +22,14 @@ export const Subheading = styled.div`
2222
2323export const PreferenceContainer = styled . div `
2424 padding-top: 0.5rem;
25+
26+ ${ props =>
27+ props . disabled &&
28+ css `
29+ opacity: 0.5;
30+ pointer-events: none;
31+ cursor: disabled;
32+ ` }
2533` ;
2634
2735export const PaddedPreference = styled ( Preference ) `
You can’t perform that action at this time.
0 commit comments