Files
mattermost-mobile/app/components/tutorial_highlight/item.tsx
Elias Nahum 5b9492356b Gekidou MultiServers second part (#5963)
* Edit Server display name

* Lock iPhone to portrait and iPad to landscape

* Create actions for app global to store device token and multi server tutorial

* Add MutliServer tutorial on first use

* WebSocket reconnection priority

* have isRecordGlobalEqualToRaw to not check for value

* Return early on edit server if error is found

* Prepopulate server screen with last logged out server address and name

* Add CompassIcon to circleCI asset generation
2022-02-17 10:42:06 -03:00

58 lines
1.7 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useMemo} from 'react';
import {StyleSheet} from 'react-native';
import Svg, {ClipPath, Defs, G, Path, Rect} from 'react-native-svg';
import tinyColor from 'tinycolor2';
import {useTheme} from '@context/theme';
import {constructRectangularPathWithBorderRadius} from '@utils/svg';
type Props = {
borderRadius?: number;
height: number;
itemBounds: TutorialItemBounds;
onDismiss: () => void;
width: number;
}
const HighlightItem = ({height, itemBounds, onDismiss, borderRadius = 0, width}: Props) => {
const theme = useTheme();
const isDark = tinyColor(theme.centerChannelBg).isDark();
const pathD = useMemo(() => {
const parent = {startX: 0, startY: 0, endX: width, endY: height};
return constructRectangularPathWithBorderRadius(parent, itemBounds, borderRadius);
}, [borderRadius, itemBounds, width]);
return (
<Svg
style={StyleSheet.absoluteFill}
onPress={onDismiss}
>
<G>
<Defs>
<ClipPath id='elementBounds'>
<Path
d={pathD}
clipRule='evenodd'
/>
</ClipPath>
</Defs>
<Rect
x={0}
y={0}
width={width}
height={height}
clipPath='#elementBounds'
fill={isDark ? 'white' : 'black'}
fillOpacity={0.3}
/>
</G>
</Svg>
);
};
export default HighlightItem;