Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { BeaconEvent, Beacon } from 'matrix-js-sdk/src/matrix';
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { BeaconEvent, Beacon } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { formatDuration } from '../../../DateUtils';
|
||||
import { useEventEmitterState } from '../../../hooks/useEventEmitter';
|
||||
import { useInterval } from '../../../hooks/useTimeout';
|
||||
import { _t } from '../../../languageHandler';
|
||||
import { getBeaconMsUntilExpiry } from '../../../utils/beacon';
|
||||
import { formatDuration } from "../../../DateUtils";
|
||||
import { useEventEmitterState } from "../../../hooks/useEventEmitter";
|
||||
import { useInterval } from "../../../hooks/useTimeout";
|
||||
import { _t } from "../../../languageHandler";
|
||||
import { getBeaconMsUntilExpiry } from "../../../utils/beacon";
|
||||
|
||||
const MINUTE_MS = 60000;
|
||||
const HOUR_MS = MINUTE_MS * 60;
|
||||
|
@ -38,11 +38,7 @@ const getUpdateInterval = (ms: number) => {
|
|||
return 1000;
|
||||
};
|
||||
const useMsRemaining = (beacon: Beacon): number => {
|
||||
const beaconInfo = useEventEmitterState(
|
||||
beacon,
|
||||
BeaconEvent.Update,
|
||||
() => beacon.beaconInfo,
|
||||
);
|
||||
const beaconInfo = useEventEmitterState(beacon, BeaconEvent.Update, () => beacon.beaconInfo);
|
||||
|
||||
const [msRemaining, setMsRemaining] = useState(() => getBeaconMsUntilExpiry(beaconInfo));
|
||||
|
||||
|
@ -66,10 +62,11 @@ const LiveTimeRemaining: React.FC<{ beacon: Beacon }> = ({ beacon }) => {
|
|||
const timeRemaining = formatDuration(msRemaining);
|
||||
const liveTimeRemaining = _t(`%(timeRemaining)s left`, { timeRemaining });
|
||||
|
||||
return <span
|
||||
data-test-id='room-live-share-expiry'
|
||||
className="mx_LiveTimeRemaining"
|
||||
>{ liveTimeRemaining }</span>;
|
||||
return (
|
||||
<span data-test-id="room-live-share-expiry" className="mx_LiveTimeRemaining">
|
||||
{liveTimeRemaining}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
export default LiveTimeRemaining;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue