|
|
@@ -20,6 +20,8 @@ type StateType = {
|
|
|
invalidEmail: boolean,
|
|
|
}
|
|
|
|
|
|
+const dummyInvites = [];
|
|
|
+
|
|
|
export default class InviteList extends Component<PropsType, StateType> {
|
|
|
state = {
|
|
|
loading: true,
|
|
|
@@ -128,9 +130,7 @@ export default class InviteList extends Component<PropsType, StateType> {
|
|
|
renderInvitations = () => {
|
|
|
let { currentProject } = this.context;
|
|
|
if (this.state.loading) {
|
|
|
- return (
|
|
|
- <Loading />
|
|
|
- )
|
|
|
+ return <Loading />;
|
|
|
} else {
|
|
|
var invContent: any[] = [];
|
|
|
for (let i = 0; i < this.state.invites.length; i++) {
|
|
|
@@ -150,7 +150,7 @@ export default class InviteList extends Component<PropsType, StateType> {
|
|
|
</CopyButton>
|
|
|
</Td>
|
|
|
</Tr>
|
|
|
- )
|
|
|
+ );
|
|
|
} else if (this.state.invites[i].expired) {
|
|
|
invContent.push(
|
|
|
<Tr key={i}>
|
|
|
@@ -179,7 +179,7 @@ export default class InviteList extends Component<PropsType, StateType> {
|
|
|
</CopyButton>
|
|
|
</Td>
|
|
|
</Tr>
|
|
|
- )
|
|
|
+ );
|
|
|
} else {
|
|
|
invContent.push(
|
|
|
<Tr key={i}>
|
|
|
@@ -214,10 +214,11 @@ export default class InviteList extends Component<PropsType, StateType> {
|
|
|
}
|
|
|
return (
|
|
|
<>
|
|
|
- <Subsubtitle>Collaborators</Subsubtitle>
|
|
|
+ <Heading>Invites & Collaborators</Heading>
|
|
|
+ <Helper>Manage pending invites and view collaborators.</Helper>
|
|
|
{invContent.length > 0
|
|
|
? <Table><tbody>{invContent}</tbody></Table>
|
|
|
- : <BodyText>This project currently has no collaborators.</BodyText>
|
|
|
+ : <Placeholder>This project currently has no invites or collaborators.</Placeholder>
|
|
|
}
|
|
|
</>
|
|
|
)
|
|
|
@@ -228,21 +229,23 @@ export default class InviteList extends Component<PropsType, StateType> {
|
|
|
return (
|
|
|
<>
|
|
|
<Heading isAtTop={true}>Share Project</Heading>
|
|
|
- <Helper>Generate a project invite for another admin user:</Helper>
|
|
|
- <CreateInvite>
|
|
|
- <InputRow
|
|
|
- value={this.state.email}
|
|
|
- type='text'
|
|
|
- setValue={(x: string) => this.setState({ email: x })}
|
|
|
- width='calc(100%)'
|
|
|
- placeholder='ex: mrp@getporter.dev'
|
|
|
- />
|
|
|
+ <Helper>Generate a project invite for another admin user.</Helper>
|
|
|
+ <DarkMatter />
|
|
|
+ <InputRow
|
|
|
+ value={this.state.email}
|
|
|
+ type='text'
|
|
|
+ setValue={(x: string) => this.setState({ email: x })}
|
|
|
+ width='calc(100%)'
|
|
|
+ placeholder='ex: mrp@getporter.dev'
|
|
|
+ />
|
|
|
+ <ButtonWrapper>
|
|
|
<InviteButton
|
|
|
+ disabled={false}
|
|
|
onClick={() => this.validateEmail()}
|
|
|
>
|
|
|
Create Invite
|
|
|
</InviteButton>
|
|
|
- </CreateInvite>
|
|
|
+ </ButtonWrapper>
|
|
|
{this.state.invalidEmail &&
|
|
|
<Invalid>
|
|
|
Invalid Email Address. Try Again.
|
|
|
@@ -256,6 +259,29 @@ export default class InviteList extends Component<PropsType, StateType> {
|
|
|
|
|
|
InviteList.contextType = Context;
|
|
|
|
|
|
+const Placeholder = styled.div`
|
|
|
+ width: 100%;
|
|
|
+ height: 200px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 23px;
|
|
|
+ justify-content: center;
|
|
|
+ background: #ffffff11;
|
|
|
+ border-radius: 5px;
|
|
|
+ color: #ffffff44;
|
|
|
+ font-size: 13px;
|
|
|
+`;
|
|
|
+
|
|
|
+const ButtonWrapper = styled.div`
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+`;
|
|
|
+
|
|
|
+const DarkMatter = styled.div`
|
|
|
+ width: 100%;
|
|
|
+ margin-top: -10px;
|
|
|
+`;
|
|
|
+
|
|
|
const Subtitle = styled.div`
|
|
|
font-size: 18px;
|
|
|
font-weight: 700;
|
|
|
@@ -290,9 +316,10 @@ const CopyButton = styled.div`
|
|
|
font-size: 13px;
|
|
|
margin-left: 12px;
|
|
|
float: right;
|
|
|
- width: 128px;
|
|
|
+ width: 120px;
|
|
|
padding-top: 7px;
|
|
|
padding-bottom: 6px;
|
|
|
+ cursor: pointer;
|
|
|
border-radius: 5px;
|
|
|
border: 1px solid #ffffff20;
|
|
|
background-color: #ffffff10;
|
|
|
@@ -305,8 +332,32 @@ const CopyButton = styled.div`
|
|
|
}
|
|
|
`;
|
|
|
|
|
|
-const InviteButton = styled(CopyButton)`
|
|
|
- margin-bottom: 14px;
|
|
|
+const InviteButton = styled.div<{ disabled: boolean }>`
|
|
|
+ height: 35px;
|
|
|
+ font-size: 13px;
|
|
|
+ font-weight: 500;
|
|
|
+ font-family: 'Work Sans', sans-serif;
|
|
|
+ color: white;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 15px;
|
|
|
+ margin-top: 10px;
|
|
|
+ text-align: left;
|
|
|
+ background: red;
|
|
|
+ float: left;
|
|
|
+ margin-left: 0;
|
|
|
+ justify-content: center;
|
|
|
+ border: 0;
|
|
|
+ border-radius: 5px;
|
|
|
+ background: ${props => !props.disabled ? '#616FEEcc' : '#aaaabb'};
|
|
|
+ box-shadow: ${props => !props.disabled ? '0 2px 5px 0 #00000030' : 'none'};
|
|
|
+ cursor: ${props => !props.disabled ? 'pointer' : 'default'};
|
|
|
+ user-select: none;
|
|
|
+ :focus { outline: 0 }
|
|
|
+ :hover {
|
|
|
+ filter: ${props => !props.disabled ? 'brightness(120%)' : ''};
|
|
|
+ }
|
|
|
+ margin-bottom: 10px;
|
|
|
`;
|
|
|
|
|
|
const Rower = styled.div`
|
|
|
@@ -317,8 +368,6 @@ const Rower = styled.div`
|
|
|
`;
|
|
|
|
|
|
const CreateInvite = styled.div`
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
margin-top: -10px;
|
|
|
`;
|
|
|
|
|
|
@@ -326,10 +375,10 @@ const ShareLink = styled.input`
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
font-size: 13px;
|
|
|
- background: #ffffff11;
|
|
|
- border: 1px solid #ffffff55;
|
|
|
- width: 50%;
|
|
|
+ background: none;
|
|
|
+ width: 60%;
|
|
|
color: #74a5f7;
|
|
|
+ margin-left: -30px;
|
|
|
padding: 5px 10px;
|
|
|
height: 30px;
|
|
|
text-overflow: ellipsis;
|
|
|
@@ -345,13 +394,15 @@ const Table = styled.table`
|
|
|
width: 100%;
|
|
|
border-spacing: 0px;
|
|
|
border: 1px solid #ffffff55;
|
|
|
+ margin-top: 22px;
|
|
|
border-radius: 5px;
|
|
|
+ background: #ffffff11;
|
|
|
`;
|
|
|
|
|
|
const Td = styled.td`
|
|
|
visibility: ${(props: { isTop: boolean, invis?: boolean }) => props.invis ? 'hidden' : 'visible'};
|
|
|
white-space: nowrap;
|
|
|
- padding: 20px 0px;
|
|
|
+ padding: 6px 0px;
|
|
|
border-top: ${(props: { isTop: boolean, invis?: boolean }) => (props.isTop ? 'none' : '1px solid #ffffff55')};
|
|
|
&:last-child {
|
|
|
padding-right: 16px;
|
|
|
@@ -362,9 +413,9 @@ const Tr = styled.tr`
|
|
|
`;
|
|
|
|
|
|
const MailTd = styled(Td)`
|
|
|
- padding-left: 16px;
|
|
|
- max-width: 242px;
|
|
|
- min-width: 242px;
|
|
|
+ padding: 0 12px;
|
|
|
+ max-width: 300px;
|
|
|
+ min-width: 300px;
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
color: #ffffff;
|