Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit de76a32

Browse files
authored
Changed "Try it Description" by removing "we are currently working on...", adding "+1 on github for feature implementation" and other CSS changes (#269)
1 parent 2446106 commit de76a32

File tree

5 files changed

+52
-41
lines changed

5 files changed

+52
-41
lines changed

src/view/components/toolbar/SensorModalUtils.tsx

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ export const TRY_IT_MAKE_CODE = (
1818
</div>
1919
);
2020

21+
export const FEATURE_REQUEST_ON_GITHUB = (
22+
<div className="link-parent">
23+
<a
24+
href="https://github.com/microsoft/vscode-python-devicesimulator/issues/268"
25+
className="link"
26+
>
27+
Upvote feature requests on GitHub {ARROW_RIGHT_SVG}
28+
</a>
29+
</div>
30+
);
31+
2132
export const TOOLBAR_ICON_LABEL = {
2233
GPIO: "GPIO",
2334
IR: "IR",
@@ -60,7 +71,7 @@ export const MICROBIT_TOOLBAR_ID = {
6071
};
6172

6273
export interface IModalContent {
63-
component: any;
74+
components: any;
6475
descriptionText: string;
6576
descriptionTitle: string;
6677
id: string;
@@ -75,7 +86,7 @@ export const DEFAULT_MODAL_CONTENT: IModalContent = {
7586
tagOutput: undefined,
7687
descriptionText: "none",
7788
tryItDescription: "none",
78-
component: undefined,
89+
components: undefined,
7990
id: "none",
8091
};
8192

@@ -89,7 +100,7 @@ export const GPIO_MODAL_CONTENT = (
89100
tagOutput: TAG_OUTPUT_SVG,
90101
descriptionText: "toolbar-gpio.description",
91102
tryItDescription: "toolbar-gpio.tryItDescription",
92-
component: undefined,
103+
components: undefined,
93104
id: "GPIO",
94105
};
95106
};
@@ -104,7 +115,7 @@ export const IR_MODAL_CONTENT = (
104115
tagOutput: TAG_OUTPUT_SVG,
105116
descriptionText: "toolbar-ir-sensor.description",
106117
tryItDescription: "toolbar-ir-sensor.tryItDescription",
107-
component: TRY_IT_MAKE_CODE,
118+
components: [TRY_IT_MAKE_CODE, FEATURE_REQUEST_ON_GITHUB],
108119
id: "IR",
109120
};
110121
};
@@ -118,12 +129,12 @@ export const LIGHT_MODAL_CONTENT = (
118129
tagOutput: undefined,
119130
descriptionText: "toolbar-light-sensor.description",
120131
tryItDescription: "toolbar-light-sensor.tryItDescription",
121-
component: (
132+
components: [
122133
<LightSensorBar
123134
onUpdateValue={onUpdateValue}
124135
value={sensorValues[SENSOR_LIST.LIGHT]}
125-
/>
126-
),
136+
/>,
137+
],
127138
id: "light_sensor",
128139
};
129140
};
@@ -142,12 +153,14 @@ export const MOTION_MODAL_CONTENT = (
142153
tagOutput: undefined,
143154
descriptionText: "toolbar-motion-sensor.description",
144155
tryItDescription: "toolbar-motion-sensor.tryItDescription",
145-
component: (
156+
components: [
146157
<MotionSensorBar
147158
onUpdateValue={onUpdateValue}
148159
axisValues={motionSensorValues}
149-
/>
150-
),
160+
/>,
161+
TRY_IT_MAKE_CODE,
162+
FEATURE_REQUEST_ON_GITHUB,
163+
],
151164
id: "motion_sensor",
152165
};
153166
};
@@ -161,7 +174,7 @@ export const NEOP_MODAL_CONTENT = (
161174
tagOutput: TAG_OUTPUT_SVG,
162175
descriptionText: "toolbar-neo-pixels.description",
163176
tryItDescription: "toolbar-neo-pixels.tryItDescription",
164-
component: undefined,
177+
components: undefined,
165178
id: "neon_pixel",
166179
};
167180
};
@@ -175,7 +188,7 @@ export const PUSHB_MODAL_CONTENT = (
175188
tagOutput: undefined,
176189
descriptionText: "toolbar-push-button.description",
177190
tryItDescription: "toolbar-push-button.tryItDescription",
178-
component: undefined,
191+
components: undefined,
179192
id: "push_btn",
180193
};
181194
};
@@ -189,7 +202,7 @@ export const RED_LED_MODAL_CONTENT = (
189202
tagOutput: TAG_OUTPUT_SVG,
190203
descriptionText: "toolbar-red-led.description",
191204
tryItDescription: "toolbar-red-led.tryItDescription",
192-
component: undefined,
205+
components: undefined,
193206
id: "red_LED",
194207
};
195208
};
@@ -203,7 +216,7 @@ export const SOUND_MODAL_CONTENT = (
203216
tagOutput: undefined,
204217
descriptionText: "toolbar-sound-sensor.description",
205218
tryItDescription: "toolbar-sound-sensor.tryItDescription",
206-
component: TRY_IT_MAKE_CODE,
219+
components: [TRY_IT_MAKE_CODE, FEATURE_REQUEST_ON_GITHUB],
207220
id: "sound_sensor",
208221
};
209222
};
@@ -217,7 +230,7 @@ export const SWITCH_MODAL_CONTENT = (
217230
tagOutput: undefined,
218231
descriptionText: "toolbar-slider-switch.description",
219232
tryItDescription: "toolbar-slider-switch.tryItDescription",
220-
component: undefined,
233+
components: undefined,
221234
id: "slider_switch",
222235
};
223236
};
@@ -231,7 +244,7 @@ export const SPEAKER_MODAL_CONTENT = (
231244
tagOutput: TAG_OUTPUT_SVG,
232245
descriptionText: "toolbar-speaker.description",
233246
tryItDescription: "toolbar-speaker.tryItDescription",
234-
component: undefined,
247+
components: [FEATURE_REQUEST_ON_GITHUB],
235248
id: "speaker",
236249
};
237250
};
@@ -240,12 +253,12 @@ export const TEMPERATURE_MODAL_CONTENT = (
240253
sensorValues: { [key: string]: number }
241254
): IModalContent => {
242255
return {
243-
component: (
256+
components: [
244257
<TemperatureSensorBar
245258
onUpdateSensor={onUpdateValue}
246259
value={sensorValues[SENSOR_LIST.TEMPERATURE]}
247-
/>
248-
),
260+
/>,
261+
],
249262
descriptionText: "toolbar-temperature-sensor.description",
250263
descriptionTitle: "toolbar-temperature-sensor.title",
251264
id: "temperature",
@@ -265,7 +278,7 @@ export const ACCELEROMETER_MODAL_CONTENT = (
265278
Z_AXIS: sensorValues[SENSOR_LIST.MOTION_Z],
266279
};
267280
return {
268-
component: (
281+
components: (
269282
<Accelerometer
270283
onUpdateValue={onUpdateValue}
271284
axisValues={accelerometerSensorValues}
@@ -289,7 +302,7 @@ export const MICROBIT_LED_CONTENT = (
289302
tagOutput: TAG_OUTPUT_SVG,
290303
descriptionText: "toolbar-microbit-led.description",
291304
tryItDescription: "toolbar-microbit-led.tryItDescription",
292-
component: undefined,
305+
components: undefined,
293306
id: "microbit_LED",
294307
};
295308
};
@@ -304,7 +317,7 @@ export const MICROBIT_BUTTON_CONTENT = (
304317
tagOutput: TAG_INPUT_SVG,
305318
descriptionText: "toolbar-microbit-button.description",
306319
tryItDescription: "toolbar-microbit-button.tryItDescription",
307-
component: undefined,
320+
components: undefined,
308321
id: "microbit_button",
309322
};
310323
};

src/view/components/toolbar/ToolBar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ class ToolBar extends React.Component<IProps, IToolbarState, any> {
164164
this.props.sensorValues
165165
) as IModalContent;
166166

167-
const component = content
168-
? content.component
169-
: DEFAULT_MODAL_CONTENT.component;
167+
const components = content
168+
? content.components
169+
: DEFAULT_MODAL_CONTENT.components;
170170

171171
return (
172172
<div className="sensor_modal">
@@ -205,7 +205,7 @@ class ToolBar extends React.Component<IProps, IToolbarState, any> {
205205
</span>
206206
<br />
207207

208-
<div>{component}</div>
208+
<div>{components}</div>
209209
</div>
210210
</div>
211211
);

src/view/styles/ToolBar.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
.sensor_modal {
3333
vertical-align: middle;
3434
width: 360px;
35-
max-height: 300px;
3635
overflow-y: visible;
3736
overflow-x: hidden;
3837
position: relative;
@@ -142,20 +141,19 @@
142141
opacity: 90%;
143142
font-size: 14px;
144143
word-wrap: break-word;
144+
padding-right: 10px;
145145
}
146146

147147
.link-parent {
148148
padding-top: 12px;
149149
-webkit-appearance: none;
150-
padding-left: 150px;
151-
color: var(--vscode-textLink-activeForeground);
150+
color: var(--vscode-textLink-foreground);
152151
text-align: right;
153152
text-decoration: none;
154153
font-weight: bold;
155154
}
156155
.link-parent:hover {
157156
-webkit-appearance: none;
158-
padding-left: 150px;
159157
color: var(--vscode-textLink-activeForeground);
160158
text-decoration: none;
161159
}

src/view/svgs/arrow_right_svg.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const ARROW_RIGHT_SVG = (
77
viewBox="0 0 14 14"
88
fill="none"
99
xmlns="http://www.w3.org/2000/svg"
10+
transform="translate(-2,2.5)"
1011
>
1112
<path
1213
fill-rule="evenodd"

src/view/translations/en.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
{
22
"toolbar-gpio.description": "8 GPIOs on the device! Pin A1 - A7 can also be used as capacitive touch sensors, and A0 is a true analog output pin.",
33
"toolbar-gpio.title": "GPIO",
4-
"toolbar-gpio.tryItDescription": "Use your mouse to interact with the pin A1 - A7 or use your keyboard SHIFT+”1” - “7”.",
4+
"toolbar-gpio.tryItDescription": "Use your mouse to interact with the pin A1 - A7 or use your keyboard SHIFT + ”1” - “7”.",
55
"toolbar-ir-sensor.description": "Allows you to send commands to the device with a remote control, or even send messages between multiple devices! You can also do very simple proximity sensing since it reads the reflected light.",
66
"toolbar-ir-sensor.title": "IR Transmit & Receiver",
7-
"toolbar-ir-sensor.tryItDescription": "We’re working hard to support this sensor on the simulator in the Device Simulator Express. You can try it on MakeCode!",
8-
"toolbar-ir-sensor.tryItTitle": "We’re working hard to support this sensor on the simulator in the Device Simulator Express. You can try it on MakeCode!",
7+
"toolbar-ir-sensor.tryItDescription": "If you would like to see this sensor supported, please +1 the feature addition issue on GitHub! For now, you can try it on MakeCode!",
98
"toolbar-light-sensor.description": "An analog light sensor can be used to detect ambient light, with similar spectral response to the human eye.",
109
"toolbar-light-sensor.title": "Light Sensor",
1110
"toolbar-light-sensor.tryItDescription": "Change the brightness from 0 - 255 here!",
12-
"toolbar-motion-sensor.description": "Detects acceleration in XYZ orientations. And can also detect 'tap' and 'double tap' strikes on the board and when the board is shaken.",
11+
"toolbar-motion-sensor.description": "Detects acceleration in X, Y and Z orientations. It can also detect 'tap' and 'double tap' strikes on the board and when the board is shaken.",
1312
"toolbar-motion-sensor.title": "Motion Sensor",
14-
"toolbar-motion-sensor.tryItDescription": "Change the acceleration here and click or click on the button to simulate a shake.The tap feature is not supported by the Device Simulator Express. You can try it on MakeCode!",
13+
"toolbar-motion-sensor.tryItDescription": "Change the acceleration here and click or click on the button to simulate a shake. The tap feature is not supported by the Device Simulator Express. If you would like to see the 'tap' feature implemented, please +1 the feature addition issue on GitHub! For now, you can try it on MakeCode!",
1514
"toolbar-neo-pixels.description": "The 10 full color RGB LEDs surrounding the outer edge of the boards can be set to any color. Great for beautiful lighting effects!",
1615
"toolbar-neo-pixels.title": "NeoPixels",
1716
"toolbar-neo-pixels.tryItDescription": "Run your code and see the cool effects on the simulator!",
1817
"toolbar-push-button.description": "Two push buttons A and B are connected to digital pin #4 (Left) and #5 (Right) each.",
1918
"toolbar-push-button.title": "Push Buttons",
20-
"toolbar-push-button.tryItDescription": "Click them with your mouse or by pressing “A” “B” on your keyboard!",
19+
"toolbar-push-button.tryItDescription": "Click them with your mouse or by pressing “A” and/or “B” on your keyboard!",
2120
"toolbar-red-led.description": "This Red LED is connected to the digital #13 GPIO pin. It can be very handy when you want an indicator LED.",
2221
"toolbar-red-led.title": "Red LED",
2322
"toolbar-red-led.tryItDescription": "Run your code and see the cool effects on the simulator!",
2423
"toolbar-sound-sensor.description": "A digital microphone can detect audio volume and even perform basic FFT functions but cannot read it like an analog voltage.",
2524
"toolbar-sound-sensor.title": "Sound Sensor",
26-
"toolbar-sound-sensor.tryItDescription": "We’re working hard to support this sensor on the simulator in the Device Simulator Express. You can try it on MakeCode!",
25+
"toolbar-sound-sensor.tryItDescription": "If you would like to see the sound sensor implemented, please +1 the feature addition issue on GitHub! For now, you can try it on MakeCode!",
2726
"toolbar-slider-switch.description": "This slide switch returns True or False depending on whether it's ON or OFF and can be used as a toggle switch in your code!",
2827
"toolbar-slider-switch.title": "Slider Switch",
2928
"toolbar-slider-switch.tryItDescription": "Click it with your mouse or press 'S' on your keyboard to switch it ON and OFF!",
30-
"toolbar-speaker.description": "This speaker can play .wav file and different tones and also has a class D amplifier that is connected to an output A0 pin built in! You can turn it off using the shutdown control on pin #11 on the physical device.",
29+
"toolbar-speaker.description": "This speaker can play a .wav file and different tones and also has a class D amplifier that is connected to an output A0 pin built in! You can turn it off using the shutdown control on pin #11 on the physical device.",
3130
"toolbar-speaker.title": "Speaker",
32-
"toolbar-speaker.tryItDescription": "Right now the tones are not supported yet on the simulator, but you can play it on your device!",
31+
"toolbar-speaker.tryItDescription": "Right now the tones are not supported on the simulator. If you would like to see tones implemented, please +1 the feature addition issue on GitHub! Regardless, you can play it on your device!",
3332
"toolbar-temperature-sensor.description": "This sensor uses an NTC thermistor to sense temperature an calculate it with the analog voltage on analog pin #A9.",
3433
"toolbar-temperature-sensor.title": "Temperature Sensor",
3534
"toolbar-temperature-sensor.tryItDescription": "You can set the temperature range from your code!",
@@ -41,5 +40,5 @@
4140
"toolbar-microbit-led.tryItDescription": "Run your code and see the LEDs light up!",
4241
"toolbar-microbit-button.title": "Buttons",
4342
"toolbar-microbit-button.description": "There are two buttons on the front of the micro:bit (labelled A and B). The third button is to trigger both A and B buttons. You can detect when these buttons are pressed, allowing you to trigger code on the device.",
44-
"toolbar-microbit-button.tryItDescription": "Click them with your mouse. Pressing “A” “B” on your keyboard will be implemented soon!"
45-
}
43+
"toolbar-microbit-button.tryItDescription": "Click them with your mouse or by pressing “A” and/or “B” on your keyboard!"
44+
}

0 commit comments

Comments
 (0)