-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
14 changed files
with
163 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
src/FilterLists.Web/ClientApp/components/detailsExpander/DetailsExpander.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...eb/ClientApp/components/detailsExpander/maintainersInfoCard/MaintainerAdditionalLists.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as React from "react"; | ||
|
||
export default class MaintainerAdditionalLists extends React.Component<IMaintainerAdditionalListsProps, any> { | ||
constructor(props: IMaintainerAdditionalListsProps) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return this.props.additionalLists.length > 0 | ||
? <div className="col-9"> | ||
<div> | ||
<h4>More by {this.props.name}:</h4> | ||
<ul> | ||
{this.props.additionalLists.map((list: IMaintainerAdditionalListsDto) => | ||
<li>{list.name}</li>)} | ||
</ul> | ||
</div> | ||
</div> | ||
: null; | ||
} | ||
} |
69 changes: 15 additions & 54 deletions
69
...Lists.Web/ClientApp/components/detailsExpander/maintainersInfoCard/MaintainerInfoCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,25 @@ | ||
import * as React from "react"; | ||
import MaintainerAdditionalLists from "./MaintainerAdditionalLists"; | ||
import MaintainerLinkButtonGroup from "./MaintainerLinkButtonGroup"; | ||
|
||
export default class MaintainerInfoCard extends React.Component<IListMaintainerDto, any> { | ||
constructor(props: IListMaintainerDto) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return <div className="card"> | ||
<div className="card-body"> | ||
<h3 className="card-header">Maintained by {this.props.name}</h3> | ||
<div className="container pt-1"> | ||
<div className="row"> | ||
<MaintainerAdditionalLists maintainer={this.props}/> | ||
<MaintainerUrls maintainer={this.props}/> | ||
</div> | ||
</div> | ||
</div> | ||
</div>; | ||
return this.props.name | ||
? <div className="card"> | ||
<div className="card-body"> | ||
<h3 className="card-header">Maintained by {this.props.name}</h3> | ||
<div className="container pt-1"> | ||
<div className="row"> | ||
<MaintainerAdditionalLists {...this.props}/> | ||
<MaintainerLinkButtonGroup {...this.props}/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
: null; | ||
} | ||
} | ||
|
||
function MaintainerAdditionalLists(props: any) { | ||
return <div className="col-9"> | ||
{props.maintainer.additionalLists.length > 0 | ||
? <div> | ||
<h4>More by {props.maintainer.name}:</h4> | ||
<ul> | ||
{props.maintainer.additionalLists.map( | ||
(list: any) => <MaintainerAdditionalList list={list} key={list.id.toString()}/>)} | ||
</ul> | ||
</div> | ||
: null} | ||
</div>; | ||
} | ||
|
||
function MaintainerAdditionalList(props: any) { | ||
return <li>{props.list.name}</li>; | ||
} | ||
|
||
function MaintainerUrls(props: any) { | ||
return <div className="col-3 p-0 btn-group-vertical justify-content-start d-flex align-items-end" role="group"> | ||
{props.maintainer.homeUrl | ||
? <a href={props.maintainer.homeUrl} className="btn btn-primary fl-btn-details-action" | ||
title={`View the home page of ${props.maintainer.name}.`}> | ||
Home | ||
</a> | ||
: null} | ||
{props.maintainer.emailAddress | ||
? <a href={`mailto:${props.maintainer.emailAddress}`} | ||
className="btn btn-primary fl-btn-details-action" | ||
title={`Email ${props.maintainer.name}.`}> | ||
</a> | ||
: null} | ||
{props.maintainer.twitterHandle | ||
? <a href={`https://twitter.com/${props.maintainer.twitterHandle}`} | ||
className="btn btn-primary fl-btn-details-action" | ||
title={`View the Twitter page of ${props.maintainer.name}.`}> | ||
</a> | ||
: null} | ||
</div>; | ||
} |
18 changes: 18 additions & 0 deletions
18
...eb/ClientApp/components/detailsExpander/maintainersInfoCard/MaintainerLinkButtonGroup.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as React from "react"; | ||
import HomeButton from "../../linkButtons/HomeButton"; | ||
import EmailButton from "../../linkButtons/EmailButton"; | ||
import TwitterButton from "../../linkButtons/TwitterButton"; | ||
|
||
export default class MaintainerLinkButtonGroup extends React.Component<IMaintainerLinkButtonGroupProps, any> { | ||
constructor(props: IMaintainerLinkButtonGroupProps) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return <div className="col-3 p-0 btn-group-vertical justify-content-start d-flex align-items-end" role="group"> | ||
<HomeButton url={this.props.homeUrl} {...this.props}/> | ||
<EmailButton {...this.props}/> | ||
<TwitterButton {...this.props}/> | ||
</div>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/FilterLists.Web/ClientApp/components/linkButtons/EmailButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from "react"; | ||
|
||
export default class EmailButton extends React.Component<IEmailButtonProps, any> { | ||
constructor(props: IEmailButtonProps) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return this.props.emailAddress | ||
? <a href={`mailto:${this.props.emailAddress}`} | ||
className="btn btn-primary fl-btn-details-action" | ||
title={`Email ${this.props.name}.`}> | ||
</a> | ||
: null; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/FilterLists.Web/ClientApp/components/linkButtons/HomeButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from "react"; | ||
|
||
export default class HomeButton extends React.Component<IUrlButtonProps, any> { | ||
constructor(props: IUrlButtonProps) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return this.props.url | ||
? <a href={this.props.url} | ||
className="btn btn-primary fl-btn-details-action" | ||
title={`View ${this.props.name}'s homepage.`}> | ||
Home | ||
</a> | ||
: null; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/FilterLists.Web/ClientApp/components/linkButtons/TwitterButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from "react"; | ||
|
||
export default class TwitterButton extends React.Component<ITwitterButtonProps, any> { | ||
constructor(props: ITwitterButtonProps) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return this.props.twitterHandle | ||
? <a href={`https://twitter.com/${this.props.twitterHandle}`} | ||
className="btn btn-primary fl-btn-details-action" | ||
title={`View ${this.props.name}'s Twitter.`}> | ||
</a> | ||
: null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ientApp/interfaces/detailsExpander/maintainersInfoCard/IMaintainerAdditionalListsProps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface IMaintainerAdditionalListsProps { | ||
name: string; | ||
additionalLists: IMaintainerAdditionalListsDto[]; | ||
} |
6 changes: 6 additions & 0 deletions
6
...ientApp/interfaces/detailsExpander/maintainersInfoCard/IMaintainerLinkButtonGroupProps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
interface IMaintainerLinkButtonGroupProps { | ||
emailAddress: string; | ||
homeUrl: string; | ||
name: string; | ||
twitterHandle: string; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/FilterLists.Web/ClientApp/interfaces/linkButtons/IEmailButtonProps.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface IEmailButtonProps { | ||
name: string; | ||
emailAddress: string; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/FilterLists.Web/ClientApp/interfaces/linkButtons/ITwitterButtonProps.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface ITwitterButtonProps { | ||
name: string; | ||
twitterHandle: string; | ||
} |