-
Notifications
You must be signed in to change notification settings - Fork 601
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
feat: add hypertext component #210
Changes from 1 commit
f063d64
a129d6a
0d262f5
209f428
ab94569
5037d28
99731f6
bdced4c
c4da12a
ad63c30
5c4b7f3
44ef96f
95f2f40
f274dfc
c825fdd
3e0f94c
c5cfa5a
3f1e52d
dad7b10
451c9ad
148ba95
5b28c9d
79d3549
1c68f4d
bd699e9
4ca8ea6
2159271
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,6 @@ class Hypertext extends Foundation<IHypertextHandledProps & IManagedClasses<IHyp | |
managedClasses: void 0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to enumerate any of the props here that are handled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think, done and done |
||
}; | ||
|
||
/** | ||
* Generates class names | ||
*/ | ||
protected generateClassNames(): string { | ||
return super.generateClassNames(this.props.managedClasses.hypertext); | ||
} | ||
|
||
/** | ||
* Renders the component | ||
*/ | ||
|
@@ -32,14 +25,20 @@ class Hypertext extends Foundation<IHypertextHandledProps & IManagedClasses<IHyp | |
); | ||
} | ||
|
||
/** | ||
* Generates class names | ||
*/ | ||
protected generateClassNames(): string { | ||
return super.generateClassNames(this.props.managedClasses.hypertext); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is new within the last day, but we'll want to use lodash's "get" method to access here. It will check that this prop actually exists.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it in, learning about lodash today |
||
} | ||
|
||
private generateAttributes(): {} { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should remove this function. Because we're not manipulating this data, it can be safely applied with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
const attributes = {}; | ||
const HREF_INDEX = "href"; | ||
const HREF_INDEX: string = "href"; | ||
|
||
if (this.props.href) { | ||
attributes[HREF_INDEX] = this.props.href; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does dot notation not work here? I know that you're likely getting an error, but if we can access via dot notation, let's do that instead. |
||
} | ||
|
||
} | ||
return attributes; | ||
} | ||
} | ||
|
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 don't think we want all html attributes here as this is just an anchor. We likely want:
React.HTMLAnchorAttributes<HTMLAnchorElement>