Skip to content

Commit

Permalink
fix: fonts for react notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstefanequilobe committed Jan 4, 2023
1 parent 10fce98 commit e6b7239
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/navigation/AppNavigator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Suspense, useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { useIntl } from 'react-intl';
import { NotificationContainer } from 'react-notifications';
import {
HashRouter as Router,
Routes,
Expand All @@ -14,7 +13,10 @@ import {
setNotificationMessage,
} from '../store/actions/appActions';
import * as Pages from '../pages';
import { createNotification } from '../utils/notificationUtils';
import {
createNotification,
NotificationContainer,
} from '../utils/notificationUtils';
import {
AppContainer,
Modal,
Expand Down
22 changes: 22 additions & 0 deletions src/utils/notificationUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import React from 'react';
import { NotificationManager } from 'react-notifications';
import { NotificationContainer as ReactNotificationContainer } from 'react-notifications';
import styled from 'styled-components';

const StyledNotificationContainer = styled('div')`
.notification-parent,
.notification-title,
.notification-message,
.notification-item {
font-family: ${props => props.theme.typography.primary.regular};
font-size: 14px;
font-weight: 400;
}
`;

export const createNotification = (type, message) => {
switch (type) {
Expand All @@ -17,3 +31,11 @@ export const createNotification = (type, message) => {
break;
}
};

export const NotificationContainer = () => {
return (
<StyledNotificationContainer>
<ReactNotificationContainer />
</StyledNotificationContainer>
);
};

0 comments on commit e6b7239

Please sign in to comment.