Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
timqian
committed
Jun 21, 2019
1 parent
cb0bb3a
commit 454dc9c
Showing
8 changed files
with
150 additions
and
13 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
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
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
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 |
---|---|---|
|
@@ -55,6 +55,7 @@ | |
|
||
.chat-section { | ||
padding-top: 0; | ||
min-height: 75vh; | ||
} | ||
|
||
.chat-title { | ||
|
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,14 @@ | ||
const Tabs = ({ groupName, focusedTab }) => ( | ||
<div className="tabs"> | ||
<ul> | ||
<li className={focusedTab === 'messages' ? 'is-active' : ''}><a href={`/chat/${groupName}`}>Messages</a></li> | ||
<li className={focusedTab === 'members' ? 'is-active' : ''}><a href={`/chat/${groupName}/members`}>Members</a></li> | ||
<li className={focusedTab === 'live' ? 'is-active' : ''}><a href={`/chat/${groupName}`}>Live</a></li> | ||
<li className={focusedTab === 'events' ? 'is-active' : ''}><a href={`/chat/${groupName}`}>Events</a></li> | ||
<li className={focusedTab === 'topic' ? 'is-active' : ''}><a href={`/chat/${groupName}`}>Topics</a></li> | ||
<li className={focusedTab === 'statics' ? 'is-active' : ''}><a href={`/chat/${groupName}`}>Statistics</a></li> | ||
</ul> | ||
</div> | ||
); | ||
|
||
export default Tabs; |
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
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,85 @@ | ||
import Head from './components/Head'; | ||
import Nav from './components/Nav'; | ||
import Footer from './components/Footer'; | ||
import ChatTabs from './components/ChatTabs'; | ||
import './members.scss'; | ||
|
||
const MemberList = ({ members }) => members.map((member) => { | ||
if (member.url || member.intro) { | ||
return ( | ||
<div className="media"> | ||
<div className="media-content"> | ||
<div className="content"> | ||
<p> | ||
<strong>{member.name}</strong> | ||
| ||
{member.url ? <a href={member.url}><small><i className="fas fa-home" /></small></a> : ''} | ||
<br /> | ||
{member.intro ? <small>{member.intro}</small> : <small> </small>} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
|
||
}); | ||
|
||
const Index = (props) => { | ||
const { | ||
group, members, | ||
} = props; | ||
|
||
|
||
return ( | ||
<div> | ||
<Head title={group.name} description={group.description} /> | ||
<Nav /> | ||
<div className="members-section section"> | ||
<br /> | ||
<div className="container"> | ||
<div className="columns"> | ||
<div className="column is-four-fifths "> | ||
<div className=""> | ||
<p className="title is-5"> | ||
<a href={`/chat/${group.name}`}> | ||
<i className="fab fa-weixin has-text-success" /> | ||
| ||
{group.name} | ||
</a> | ||
</p> | ||
<p className="subtitle is-6"> | ||
{group.description} | ||
| ||
<a href="https://jinshuju.net/f/hgoWO3" className="tag is-small is-success">I'm a member of this group</a> | ||
</p> | ||
|
||
<ChatTabs groupName={group.name} focusedTab="members" /> | ||
|
||
|
||
<MemberList members={members} /> | ||
|
||
<br /> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<Footer /> | ||
</div> | ||
); | ||
}; | ||
|
||
// load data from server (or in browser if nav using Link) | ||
// ref: https://stackoverflow.com/a/52136943/4674834 | ||
Index.getInitialProps = async ({ | ||
query: { | ||
group, members, | ||
}, | ||
}) => ({ | ||
group, members, | ||
}); | ||
|
||
export default Index; |
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 @@ | ||
.members-section { | ||
padding-top: 0; | ||
min-height: 75vh; | ||
} |