Skip to content

Commit b57b57b

Browse files
authored
Merge pull request #33 from nutboltu/docs/update-readme
fix: hide svg and update readme
2 parents d7b4df6 + c8e8257 commit b57b57b

5 files changed

Lines changed: 30 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Storybook Addon Mock Request
22

3-
[![dependencies Status](https://david-dm.org/nutboltu/storybook-addon-mock/status.svg)](https://david-dm.org/nutboltu/storybook-addon-mock) [![Actions Status](https://github.com/nutboltu/storybook-addon-mock/workflows/CI/badge.svg)](https://github.com/nutboltu/storybook-addon-mock/actions)
3+
[![dependencies Status](https://david-dm.org/nutboltu/storybook-addon-mock/status.svg)](https://david-dm.org/nutboltu/storybook-addon-mock) [![Actions Status](https://github.com/nutboltu/storybook-addon-mock/workflows/CI/badge.svg)](https://github.com/nutboltu/storybook-addon-mock/actions) ![npm](https://img.shields.io/npm/dm/storybook-addon-mock.svg) [![npm version](https://badge.fury.io/js/storybook-addon-mock.svg)](https://badge.fury.io/js/storybook-addon-mock)
44

55
<a href="https://twitter.com/intent/follow?screen_name=nutboltu">
66
<img src="https://img.shields.io/twitter/follow/nutboltu.svg?label=Follow%20@nutboltu" alt="Follow @nutboltu" />
@@ -10,6 +10,8 @@
1010

1111
This addon allows you to mock fetch or XMLHttprequest requests in storybook. If your component depends on backend apis, and your backend apis are not ready yet to feed your component, then this addon provides mock response to build your component.
1212

13+
[Live Demo](https://nutboltu.github.io/storybook-addon-mock)
14+
1315
## Why we need this
1416

1517
There are few packages those help the developers to mock the backend apis while building components. But those packages aren't integrated properly in storybook and also there's no scope to play with those apis in the storybook. `storybook-addon-mock` provides a dedicated panel in the storybook which helps the developer to view and update the apis with multiple scenarios.
@@ -96,4 +98,4 @@ storiesOf('Mock Response Story', module)
9698

9799
## License
98100

99-
MIT Licensed. Copyright (c) Farhad Yasir.
101+
This project is licensed under the MIT License - see the LICENSE file in the source code for details.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "storybook-addon-mock",
3-
"version": "0.1.0",
3+
"version": "1.0.0",
44
"description": "A storybook addon to mock http request",
55
"main": "dist/index.js",
66
"scripts": {

src/components/Field/styled.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,19 @@ export const FieldContainer = styled.div`
1717
export const Label = styled.div`
1818
font-weight: 700;
1919
flex: 0.3 0 0;
20+
min-width: 60px;
21+
font-size: 14px;
2022
`;
2123

2224
export const FieldItem = styled.div`
2325
display: flex;
2426
flex: 0.7 0 0;
27+
font-size: 14px;
28+
29+
> div > div > svg > path {
30+
opacity: 0;
31+
}
32+
> div > div > div > span > div > div > svg > path {
33+
opacity: 0;
34+
}
2535
`;

src/components/RequestItem/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import JSONInput from 'react-json-editor-ajrm';
4-
import { Checkbox, Row, Container } from './styled';
4+
import { Checkbox, Row, Container, Select } from './styled';
55
import { Field } from '../Field';
66
import statusTextMap from '../../utils/statusMap';
77

@@ -32,7 +32,7 @@ export const RequestItem = ({
3232
<Row>
3333
<Field label="Method"> {method} </Field>
3434
<Field label="Status">
35-
<select onChange={onStatusChange}>
35+
<Select onChange={onStatusChange}>
3636
{statusCodes.map((option) => (
3737
<option
3838
key={option}
@@ -41,7 +41,7 @@ export const RequestItem = ({
4141
{option}
4242
</option>
4343
))}
44-
</select>
44+
</Select>
4545
</Field>
4646
</Row>
4747

@@ -62,6 +62,10 @@ export const RequestItem = ({
6262
warningBox: {
6363
background: 'white',
6464
},
65+
body: {
66+
fontFamily: 'inherit',
67+
fontSize: '12px',
68+
},
6569
}}
6670
waitAfterKeyPress={1000}
6771
height="120px"

src/components/RequestItem/styled.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ export const Checkbox = styled.input`
1111
width: 20px;
1212
`;
1313

14+
export const Select = styled.select`
15+
height: 24px;
16+
width: 60px;
17+
border-radius: 2px;
18+
border: 1px solid;
19+
font-size: 14px;
20+
`;
21+
1422
export const Row = styled.div`
1523
display: flex;
1624
flex-direction: row;

0 commit comments

Comments
 (0)