-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reactjs pattern library components #91
Conversation
packages/components/.gitignore
Outdated
@@ -0,0 +1 @@ | |||
/dist/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about standardising with the rest of the packages and using build/
for builds
README.md
Outdated
@@ -17,6 +17,7 @@ We hope that those tools will be useful for creation of interesting applications | |||
| [`@joincivil/core`][core-url] | [![npm link](https://img.shields.io/badge/npm-core-blue.svg)](https://www.npmjs.com/package/@joincivil/core) | JS library for interacting with Civil ecosystem | | |||
| [`@joincivil/tslint-rules`](/packages/tslint-rules) | [![npm link](https://img.shields.io/badge/npm-tslint--rules-blue.svg)](https://www.npmjs.com/package/@joincivil/tslint-rules) | Linting rules for Civil's Typescript packages | | |||
| [`@joincivil/utils`](/packages/utils) | [![npm link](https://img.shields.io/badge/npm-utils-blue.svg)](https://www.npmjs.com/package/@joincivil/utils) | Utilities shared between Civil projects used during runtime | | |||
| [`@joincivil/components`](/packages/components) | [![npm link](https://img.shields.io/badge/npm-components-blue.svg)](https://www.npmjs.com/package/@joincivil/components) | ReactJS components used in Civil webapps | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between the components from dapp? Move them from dapp, or merge this package with dapp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dapp could use components from this library. mostly this is for civil-web and editor
packages/components/package.json
Outdated
"build": "tsc", | ||
"lint": "tslint --exclude \"**/storyFixtures/**\" --project ./", | ||
"clean": "rimraf build/", | ||
"prepublish": "yarn build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use npm-run-all
package and do run-s build
to make it work with all managers and systems
|
||
import { colors, fonts } from "./styleConstants"; | ||
|
||
export interface ButtonProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are any of those required?
If so you can use:
interface ButtonProps {
className: string;
...
}
interface ButtonOptions extends Partial<ButtonProps> {
onClick?(ev: any): any;
}
packages/components/src/Button.tsx
Outdated
disabled?: boolean; | ||
inputRef?: any; | ||
name?: string; | ||
onClick?(ev: any): any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the result is not important you can use onClick?(ev: any): void
and it will work
background-color: ${colors.accent.CIVIL_BLUE_FADED}; | ||
color: ${colors.basic.WHITE}; | ||
} | ||
:disabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&:disabled
?
constructor(props: FullScreenModalProps) { | ||
super(props); | ||
this.state = {}; | ||
if (typeof document !== "undefined") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not document !== undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if document is not defined this would throw an error "document is not defined", whereas if you do typeof document
it returns the string "undefined"
CIVIL_BLUE_1: "#2B56FF", | ||
}, | ||
accent: { | ||
CIVIL_YELLOW: "#FF120", // Civil-wide accent color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would enjoy more descriptive names telling what scenarios are they used in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied these from the styled guide. feel free to color (heh) this in a bit more @juliahimmel !
|
what's the status of this PR? |
waiting for @walfly to review |
6d140f8
to
dadd1e1
Compare
Pull Request Test Coverage Report for Build 3243
💛 - Coveralls |
No description provided.