Skip to content
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

Minor iterations multiple places #3525

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ const Dropdown = ({
);
};

const List = ({ children }: { children: ReactNode }) => (
<ul className={styles.dropdownList}>{children}</ul>
type ListProps = {
children: ReactNode;
} & HTMLAttributes<HTMLUListElement>;

const List = ({ children, className }: ListProps) => (
<ul className={cx(className, styles.dropdownList)}>{children}</ul>
);

const ListItem = (props: HTMLAttributes<HTMLLIElement>) => <li {...props} />;
Expand Down
4 changes: 2 additions & 2 deletions app/components/EventItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ const TimeStamp = ({ event }) => {
<Flex alignItems="center">
<Icon
name="calendar-number-outline"
size={23}
size={20}
style={{ cursor: 'pointer', marginRight: '10px' }}
/>
<Time time={event.startTime} format="ll" />
</Flex>
<Flex alignItems="center">
<Icon
name="time-outline"
size={23}
size={20}
style={{ cursor: 'pointer', marginRight: '10px' }}
/>
<Time time={event.startTime} format="HH:mm" />
Expand Down
28 changes: 12 additions & 16 deletions app/components/HeaderNotifications/HeaderNotifications.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
@import url('~app/styles/variables.css');

.notifications {
display: flex;
flex-direction: column;
align-items: center;
width: 400px;

@media (--small-viewport) {
Expand All @@ -16,32 +13,25 @@
}
}

.maxHeight {
max-height: 400px;
}

.notification {
border-bottom: 1px solid var(--border-gray);
padding: 15px 15px 0;
display: flex;
flex-direction: row;
color: var(--lego-font-color);
line-height: 1.5;

&:last-child {
border-bottom: none;
}

&:hover {
background-color: var(--additive-background);
}
line-height: 1.4;
cursor: pointer;
}

.innerNotification {
width: 100%;
display: flex;
flex-direction: row;
padding-right: 15px;
word-break: break-word;
white-space: pre-line;
border-bottom: 1px solid var(--border-gray);
padding-bottom: 15px;
}

.unRead {
Expand All @@ -52,3 +42,9 @@
padding-top: 1px;
padding-right: 15px;
}

.updatedAt {
display: block;
margin: 0;
color: var(--secondary-font-color);
}
32 changes: 9 additions & 23 deletions app/components/HeaderNotifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ const NotificationElement = ({
<Time
time={notification.updatedAt}
wordsAgo
style={{
margin: '0',
display: 'block',
}}
className={styles.updatedAt}
/>
</div>
</div>
Expand All @@ -69,13 +66,15 @@ export default class NotificationsDropdown extends Component<Props, State> {
};
renderNotifications = (notifications: Array<Record<string, any>>) => {
return (
<div>
<Dropdown.List className={styles.maxHeight}>
{notifications.map((notification) => (
<ErrorBoundary hidden key={notification.id}>
<NotificationElement notification={notification} />
</ErrorBoundary>
<Dropdown.ListItem key={notification.id}>
<ErrorBoundary hidden>
<NotificationElement notification={notification} />
</ErrorBoundary>
</Dropdown.ListItem>
))}
</div>
</Dropdown.List>
);
};

Expand Down Expand Up @@ -108,20 +107,7 @@ export default class NotificationsDropdown extends Component<Props, State> {
>
{/* TODO FIXME - do same as the menu element*/}
{notifications.length ? (
<div
style={{
width: '100%',
}}
>
<div
style={{
maxHeight: '400px',
overflowY: 'auto',
}}
>
{this.renderNotifications(notifications)}
</div>
</div>
<>{this.renderNotifications(notifications)}</>
) : (
<h2
style={{
Expand Down
1 change: 1 addition & 0 deletions app/components/Pill/Pill.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
text-align: center;
font-size: 0.9rem;
font-weight: 600;
color: var(--lego-font-color);
}
2 changes: 1 addition & 1 deletion app/components/Table/Table.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

.icon {
color: var(--color-gray-6);
color: var(--color-gray-7);
}

.iconActive {
Expand Down
4 changes: 4 additions & 0 deletions app/routes/articles/components/ArticleDetail.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
margin-top: 8px;
}

.detail {
color: var(--secondary-font-color);
}

span.detail + span.detail {
margin-left: 10px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,9 @@ a.transparent:hover {
justify-content: center;
cursor: pointer;
color: var(--color-red-3);
transition: color var(--easing-medium);

&:hover {
color: var(--color-red-5);
}
}
7 changes: 0 additions & 7 deletions app/routes/events/components/Toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
}
}

.time {
grid-area: time;
display: flex;
justify-content: flex-start;
align-items: center;
}

.create {
grid-area: create;
display: flex;
Expand Down
4 changes: 1 addition & 3 deletions app/routes/events/components/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ type Props = {

const Toolbar = ({ actionGrant }: Props) => (
<div className={styles.root}>
<div className={styles.time}>
<Time format="ll" className={styles.timeNow} />
</div>
<Time format="ll" className={styles.timeNow} />

<NavLink
exact
Expand Down
6 changes: 0 additions & 6 deletions app/routes/overview/components/CompactEvents.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
text-align: left;
}

.compactEvents h3 {
margin-bottom: 10px;
}

.compactLeft {
padding-right: 20px;
}

.compactLeft,
.compactRight {
flex: 1;
padding-top: 5px;
padding-bottom: 5px;

@media (--mobile-device) {
padding: 0 10px 10px;
Expand Down
4 changes: 4 additions & 0 deletions app/routes/users/components/UserSettingsNotifications.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
.table td div {
justify-content: center;
}

.table tr:nth-child(even) {
background-color: rgba(var(--rgb-min), var(--rgb-min), var(--rgb-min), 3%);
}
1 change: 1 addition & 0 deletions app/routes/users/components/UserSettingsOAuth2.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
}

.deleteIcon {
justify-content: center;
cursor: pointer;
color: var(--color-red-3);
transition: color var(--easing-medium);
Expand Down
24 changes: 15 additions & 9 deletions app/routes/users/components/UserSettingsOAuth2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Link } from 'react-router-dom';
import Button from 'app/components/Button';
import Icon from 'app/components/Icon';
import Flex from 'app/components/Layout/Flex';
import { ConfirmModalWithParent } from 'app/components/Modal/ConfirmModal';
import Table from 'app/components/Table';
import Time from 'app/components/Time';
import Tooltip from 'app/components/Tooltip';
Expand All @@ -14,7 +15,7 @@ import styles from './UserSettingsOAuth2.css';
type Props = {
applications: Array<any>;
grants: Array<any>;
deleteOAuth2Grant: (grantId: number) => void;
deleteOAuth2Grant: (grantId: number) => Promise<void>;
actionGrant: Array<string>;
fetchingApplications: boolean;
fetchingGrants: boolean;
Expand Down Expand Up @@ -90,15 +91,20 @@ const UserSettingsOAuth2 = (props: Props) => {
{
dataIndex: 'delete',
render: (id, grant) => (
<Tooltip
content="Fjern"
onClick={() => props.deleteOAuth2Grant(grant.id)}
style={{
marginTop: '-7px',
}}
<ConfirmModalWithParent
title="Bekreft handling"
message={`Er du sikker på at du vil fjerne token?`}
onConfirm={() => props.deleteOAuth2Grant(grant.id)}
closeOnCancel
>
<Icon name="trash-outline" size={20} className={styles.deleteIcon} />
</Tooltip>
<Tooltip content="Fjern" style={{ marginTop: '-7px' }}>
<Icon
name="trash-outline"
size={18}
className={styles.deleteIcon}
/>
</Tooltip>
</ConfirmModalWithParent>
),
},
];
Expand Down
12 changes: 6 additions & 6 deletions app/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ ul {
list-style: none;
}

h1 {
font-size: 30px;
margin: 15px 0;
}

h1,
h2,
h3,
h4 {
Expand Down Expand Up @@ -102,12 +108,6 @@ th:last-child {
border-radius: 0 2em 2em 0;
}

h1 {
font-size: 30px;
font-weight: bold;
margin: 15px 0;
}

label {
display: block;
}
2 changes: 1 addition & 1 deletion app/styles/overlay.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

.dropdownList {
border-radius: inherit;
overflow: hidden;
overflow-y: auto;
}

.dropdownList > li > a,
Expand Down