Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3307 from withspectrum/2.4.8
Browse files Browse the repository at this point in the history
2.4.8
  • Loading branch information
brianlovin authored Jun 13, 2018
2 parents e69a639 + a91b02e commit 6da5ae0
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 7 deletions.
5 changes: 4 additions & 1 deletion hyperion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ if (process.env.NODE_ENV === 'development') {

app.get('*', (req: express$Request, res, next) => {
// Electron requests should only be client-side rendered
if (req.headers['user-agent'].indexOf('Electron') > -1) {
if (
req.headers['user-agent'] &&
req.headers['user-agent'].indexOf('Electron') > -1
) {
return res.sendFile(path.resolve(__dirname, '../build/index.html'));
}
next();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Spectrum",
"version": "2.4.7",
"version": "2.4.8",
"license": "BSD-3-Clause",
"devDependencies": {
"babel-cli": "^6.24.1",
Expand Down
2 changes: 1 addition & 1 deletion shared/middlewares/thread-param.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const threadParamRedirect = (req, res, next) => {
// Redirect /?t=asdf123 if the user isn't logged in
if (!req.user && req.query.t) {
if (req.query.t) {
res.redirect(`/thread/${req.query.t}`);
// Redirect /anything?thread=asdf123
} else if (req.query.thread) {
Expand Down
6 changes: 6 additions & 0 deletions src/components/profile/style.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
import styled from 'styled-components';
import Link from 'src/components/link';
import {
Expand Down Expand Up @@ -261,6 +262,11 @@ export const ProfileCard = styled(Card)`
}
`;

export const ThreadProfileCard = styled(ProfileCard)`
border-radius: 8px;
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
`;

export const ProUpgrade = styled.div`
margin: 16px;
margin-top: 0;
Expand Down
6 changes: 3 additions & 3 deletions src/components/profile/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import compose from 'recompose/compose';
import Link from 'src/components/link';
import { connect } from 'react-redux';
import { ThreadListItem } from '../listItems';
import { ProfileCard } from './style';
import { ThreadProfileCard } from './style';
import type { GetThreadType } from 'shared/graphql/queries/thread/getThread';

type Props = {
Expand Down Expand Up @@ -39,7 +39,7 @@ class ThreadWithData extends React.Component<Props> {
}

return (
<ProfileCard>
<ThreadProfileCard>
<Link
to={{
search: `?thread=${thread.id}`,
Expand All @@ -53,7 +53,7 @@ class ThreadWithData extends React.Component<Props> {
}`}
/>
</Link>
</ProfileCard>
</ThreadProfileCard>
);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/views/community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ class CommunityView extends React.Component<Props, State> {
icon={isMember ? 'checkmark' : null}
loading={state.isLoading}
dataCy={'join-community-button'}
style={{ marginTop: '16px' }}
>
{isMember ? 'Member' : `Join ${community.name}`}
</LoginButton>
Expand Down
6 changes: 5 additions & 1 deletion src/views/notifications/components/newMessageNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export const NewMessageNotification = ({ notification, currentUser }) => {
const date = parseNotificationDate(notification.modifiedAt);
const context = parseContext(notification.context, currentUser);
const unsortedMessages = notification.entities.map(notif => notif.payload);
const messages = sortAndGroupNotificationMessages(unsortedMessages);
let messages = sortAndGroupNotificationMessages(unsortedMessages);

if (messages.length > 3) {
messages = messages.splice(0, messages.length - 3);
}

return (
<NotificationCard isSeen={notification.isSeen}>
Expand Down
6 changes: 6 additions & 0 deletions src/views/notifications/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const NotificationCard = styled(Card)`
padding-bottom: 24px;
overflow: hidden;
transition: ${Transition.hover.off};
border-radius: 8px;
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
&:hover {
transition: none;
Expand All @@ -34,6 +36,8 @@ export const SegmentedNotificationCard = styled(Card)`
padding: 0;
padding-top: 16px;
transition: ${Transition.hover.off};
border-radius: 8px;
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
&:hover {
transition: none;
Expand Down Expand Up @@ -259,6 +263,8 @@ export const RequestCard = styled(Card)`
align-items: center;
justify-content: space-between;
padding: 16px 16px 16px 24px;
border-radius: 8px;
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
> p {
font-weight: 700;
Expand Down
31 changes: 31 additions & 0 deletions src/views/thread/components/actionBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,37 @@ class ActionBar extends React.Component<Props, State> {
</Clipboard>
</ShareButtons>
)}
{thread.channel.isPrivate && (
<ShareButtons>
<Clipboard
style={{ background: 'none' }}
data-clipboard-text={`https://spectrum.chat/thread/${
thread.id
}`}
onSuccess={() =>
this.props.dispatch(
addToastWithTimeout('success', 'Copied to clipboard')
)
}
>
<ShareButton
tipText={'Copy link'}
tipLocation={'top-left'}
data-cy="thread-copy-link-button"
>
<a>
<Icon
glyph={'link'}
size={24}
onClick={() =>
track(events.THREAD_SHARED, { method: 'link' })
}
/>
</a>
</ShareButton>
</Clipboard>
</ShareButtons>
)}
</div>

<div style={{ display: 'flex' }}>
Expand Down

0 comments on commit 6da5ae0

Please sign in to comment.