|
1 | 1 | import './index.scss'; |
| 2 | +import './__experimental__typography.scss'; |
2 | 3 |
|
3 | 4 | import React, { useEffect, useReducer, useState } from 'react'; |
4 | 5 | import PropTypes from 'prop-types'; |
@@ -52,6 +53,7 @@ export default function Sendbird(props) { |
52 | 53 | const { |
53 | 54 | logLevel = '', |
54 | 55 | userMention = {}, |
| 56 | + isREMUnitEnabled = false, |
55 | 57 | } = config; |
56 | 58 | const [logger, setLogger] = useState(LoggerFactory(logLevel)); |
57 | 59 | const [pubSub, setPubSub] = useState(); |
@@ -101,6 +103,14 @@ export default function Sendbird(props) { |
101 | 103 | useEffect(() => { |
102 | 104 | setCurrenttheme(theme); |
103 | 105 | }, [theme]); |
| 106 | + |
| 107 | + useEffect(() => { |
| 108 | + const body = document.querySelector('body'); |
| 109 | + body.classList.remove('sendbird-experimental__rem__units'); |
| 110 | + if (isREMUnitEnabled) { |
| 111 | + body.classList.add('sendbird-experimental__rem__units'); |
| 112 | + } |
| 113 | + }, [isREMUnitEnabled]); |
104 | 114 | // add-remove theme from body |
105 | 115 | useEffect(() => { |
106 | 116 | logger.info('Setup theme', `Theme: ${currenttheme}`); |
@@ -228,6 +238,7 @@ Sendbird.propTypes = { |
228 | 238 | maxMentionCount: PropTypes.number, |
229 | 239 | maxSuggestionCount: PropTypes.number, |
230 | 240 | }), |
| 241 | + isREMUnitEnabled: PropTypes.bool, |
231 | 242 | }), |
232 | 243 | stringSet: PropTypes.objectOf(PropTypes.string), |
233 | 244 | colorSet: PropTypes.objectOf(PropTypes.string), |
|
0 commit comments