UNPKG

@td-design/react-native-rating

Version:

基于 @td-design/react-native 的 rating 组件

33 lines 4.46 kB
import React from 'react'; import { SvgXml } from 'react-native-svg'; import { useTheme } from '@td-design/react-native'; const SwipeStar = _ref => { let { width = 40, height = 40, ...restProps } = _ref; const theme = useTheme(); const { bgColor = theme.colors.background, strokeColor = theme.colors.func200 } = restProps; const xml = ` <svg width=${width} height=${height} viewBox="0 0 80 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>star</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="star" fill-rule="nonzero"> <path d="M80,0 L80,80 L0,80 L0,0 L80,0 Z M39.9888734,4 C37.764954,4 35.731337,5.30862308 34.7337808,7.38162792 L27.5325576,22.695565 C27.0489394,23.632796 26.1666324,24.2741488 25.1561538,24.422983 L9.03261518,26.9014524 C6.81871742,27.2657196 4.98944788,28.8976888 4.30141154,31.122361 C3.58335378,33.3464074 4.17254414,35.8029246 5.8100678,37.412416 L17.4580463,49.1964118 C18.1824133,49.9416956 18.5290786,50.9985472 18.3942053,52.0504068 L15.5893289,68.8664466 C15.2742964,70.6372876 15.7516161,72.4612466 16.8855491,73.8196302 C18.0312864,75.1843692 19.6795911,75.976329 21.4187192,75.997679 C22.379976,76.0165872 23.327366,75.7565662 24.155184,75.2466278 L38.6296424,67.2141336 C39.0894234,67.0277718 39.5767482,66.9261208 40.0698872,66.913713 C40.5734358,66.9031742 41.0705792,67.0327982 41.5101318,67.2892386 L56.0566026,75.2466278 C56.8690762,75.7291872 57.7861214,75.9876824 58.721055,75.997679 C60.4453508,75.9584982 62.0690248,75.143008 63.1734932,73.7614418 C64.2779618,72.3798756 64.7551482,70.5674254 64.4820338,68.7913414 L61.7455688,52.0504068 C61.5743872,50.9951428 61.9266614,49.9211916 62.681728,49.1964118 L74.2540936,37.337311 C75.8492302,35.6949058 76.4080926,33.2483286 75.6943382,31.0322348 C74.9689446,28.8428064 73.1405414,27.252491 70.9451314,26.9014524 L54.8215928,24.422983 C53.8077954,24.2830124 52.9219828,23.6391112 52.445189,22.695565 L45.243966,7.38162792 C44.2464096,5.30862308 42.2127928,4 39.9888734,4 Z" id="bg" fill="${bgColor}"></path> <path d="M39.9888736,4.5 C41.0034868,4.5 41.9744924,4.79900194 42.8057374,5.33390426 C43.6415098,5.8717199 44.3359444,6.64776882 44.7914964,7.5943974 L44.7914964,7.5943974 L51.9989298,22.9210696 C52.5514164,24.0144072 53.5798966,24.7562906 54.7456268,24.9171786 L54.7456268,24.9171786 L70.8661864,27.3951808 C71.8705696,27.5557782 72.7906492,28.000453 73.5428552,28.6547096 C74.299321,29.3126712 74.8860554,30.1824276 75.2184144,31.1855196 C75.5472502,32.2065022 75.5828566,33.2805742 75.352606,34.2885612 C75.1229236,35.2940598 74.628588,36.23406 73.896241,36.9881106 L73.896241,36.9881106 L62.3354834,48.8356984 C61.4639266,49.672296 61.0542748,50.911447 61.2521182,52.1310664 L61.2521182,52.1310664 L63.987843,68.8673354 C64.2395726,70.5043526 63.801203,72.1755114 62.782951,73.44923 C61.7725272,74.713157 60.2879752,75.4619458 58.7264014,75.4977082 C57.879116,75.4886486 57.0481796,75.2540222 56.2965624,74.8079718 L56.2965624,74.8079718 L41.762093,66.8573644 C41.2424482,66.5541972 40.654652,66.4013654 40.057311,66.4138716 C39.4938152,66.4280498 38.937062,66.5460192 38.4128616,66.7626034 L38.4128616,66.7626034 L23.8929444,74.8209168 C23.147435,75.2801528 22.2943256,75.5148062 21.424857,75.4977172 C19.8295407,75.4781326 18.3190004,74.74945 17.2693892,73.499214 C16.2287868,72.2526348 15.7925888,70.5785926 16.0825155,68.9487094 L16.0825155,68.9487094 L18.8901451,52.1139984 C19.0445697,50.9096612 18.6454755,49.7007408 17.8136461,48.844917 L17.8136461,48.844917 L6.16055584,37.0558238 C5.4092605,36.3173896 4.89919534,35.3843172 4.6586071,34.3812304 C4.4173719,33.3754462 4.44693986,32.2989842 4.779088,31.2700948 C5.09542576,30.2472596 5.67349722,29.3601904 6.4276748,28.6873564 C7.1775119,28.0183946 8.10149474,27.5613788 9.1085817,27.395648 L9.1085817,27.395648 L25.2290134,24.9176462 C26.3958594,24.7457804 27.4177998,24.0083368 27.9850278,22.9083346 L27.9850278,22.9083346 L35.1843292,7.59843744 C35.641803,6.64776882 36.3362374,5.87171994 37.1720098,5.3339043 C38.0032548,4.79900196 38.9742604,4.5 39.9888736,4.5 Z" id="border" stroke="${strokeColor}" stroke-width="1"></path> </g> </g> </svg> `; return /*#__PURE__*/React.createElement(SvgXml, { xml: xml, width: width, height: height }); }; export default SwipeStar; //# sourceMappingURL=SwipeStar.js.map