@ant-design/icons#ShareAltOutlined JavaScript Examples
The following examples show how to use
@ant-design/icons#ShareAltOutlined.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SocialSharing.js From website with MIT License | 6 votes |
SocialSharing = ({ message }) => {
const handleWpSharing = () => {
const url = `whatsapp://send?text=${encodeURIComponent(message())}`;
window.open(url, '_blank');
};
const handleFbSharing = () => {
const url = `https://www.facebook.com/sharer/sharer.php?u=${document.location.href}`;
window.open(url, '_blank');
};
const menu = (
<Menu>
<Menu.Item key='1' onClick={handleWpSharing}>
<WhatsAppOutlined /> Via WhatsApp
</Menu.Item>
<Menu.Item key='2' onClick={handleFbSharing}>
<FacebookOutlined /> Via Facebook
</Menu.Item>
</Menu>
);
return (
<div className='social-sharing'>
<Dropdown overlay={menu} trigger={['click', 'hover']}>
<Button>
<ShareAltOutlined /> Compartilhar
</Button>
</Dropdown>
</div>
);
}
Example #2
Source File: router.js From credit with Apache License 2.0 | 6 votes |
institutionRoutes = [
{
path: "/admin/institutiondashboard",
component: InstitutionDashboard,
isShow: true,
title: "综合看板",
icon: AreaChartOutlined
},
{
path: "/admin/datashare",
component: dataShare,
isShow: true,
title: "数据共享",
icon: ShareAltOutlined
},
{
path: "/admin/modelsearch",
component: modelSearch,
isShow: true,
title: "模型搜索",
icon: SearchOutlined
},
{
path: "/admin/learning",
component: learning,
isShow: true,
title: "联邦学习",
icon: GlobalOutlined
},
{
path: "/admin/creditAuth",
component: creditAuth,
isShow: true,
title: "信用认证",
icon: SafetyCertificateOutlined
},
]
Example #3
Source File: ReferralButton.jsx From ui with MIT License | 4 votes |
ReferralButton = () => {
const [visible, setVisible] = useState(false);
const [email, setEmail] = useState('');
const [isEmailValid, setIsEmailValid] = useState(false);
const [customMessage, setCustomMessage] = useState(initialMessage);
const HOOK_URL = 'aHR0cHM6Ly9ob29rcy5zbGFjay5jb20vc2VydmljZXMvVDAxNTVEWkZWTTAvQjAyQVk0ODQxQ0cvQ0x3Mms4dTBtMkUzcDBVNUhhbjBqeTBv'; // pragma: allowlist secret
const submitReferral = async () => {
setVisible(false);
let user;
try {
user = await Auth.currentAuthenticatedUser();
} catch (e) {
console.warn('User not authenticated');
}
const userContext = user ? [
{
type: 'mrkdwn',
text: '*From:*',
},
{
type: 'mrkdwn',
text: user.attributes.name,
},
{
type: 'mrkdwn',
text: '*Email:*',
},
{
type: 'plain_text',
text: user.attributes.email,
},
{
type: 'mrkdwn',
text: '*User UUID:*',
},
{
type: 'plain_text',
text: user.username,
},
] : [];
const referralData = {
blocks: [
{
type: 'section',
text: {
type: 'plain_text',
text: `To: ${email}`,
},
},
{
type: 'section',
text: {
type: 'plain_text',
text: `Message:\n ${customMessage}`,
},
},
{
type: 'divider',
},
{
type: 'context',
elements: [
...userContext,
],
},
],
};
try {
const r = await fetch(atob(HOOK_URL), {
method: 'POST',
body: JSON.stringify(referralData),
});
if (!r.ok) {
throw new Error('Invalid status code returned.');
}
setEmail('');
setCustomMessage(initialMessage);
pushNotificationMessage('success', endUserMessages.REFERRAL_SUCCESSFUL);
} catch (e) {
handleError(e, endUserMessages.REFERRAL_ERROR);
}
};
const overlay = () => (
<div>
<Card size='small'>
<Space direction='vertical' style={{ width: '100%' }}>
<Input
addonBefore='To: '
label='Email'
onChange={(e) => {
const { isValid } = validateInput(e.target.value, rules.VALID_EMAIL);
setIsEmailValid(isValid);
setEmail(e.target.value);
}}
placeholder={'Your friend\'s email address'}
/>
<TextArea
value={customMessage}
label='Custom message'
onChange={(e) => {
setCustomMessage(e.target.value);
}}
rows={4}
style={{
resize: 'none', width: 300, outline: 'none',
}}
/>
<Space>
<Button size='small' onClick={() => setVisible(false)}>Cancel</Button>
<Tooltip
title={!isEmailValid ? 'Please enter a valid email address' : ''}
>
<Button size='small' type='primary' disabled={!isEmailValid} onClick={submitReferral}>Send invite</Button>
</Tooltip>
</Space>
</Space>
</Card>
</div>
);
return (
<Dropdown
visible={visible}
onVisibleChange={(v) => setVisible(v)}
overlay={overlay}
placement='bottomRight'
trigger='click'
>
<Button type='dashed' icon={<ShareAltOutlined />}>
Invite a friend
<DownOutlined />
</Button>
</Dropdown>
);
}
Example #4
Source File: Poll.js From Insta-Poll with MIT License | 4 votes |
Poll = (props) => {
const id = props.match.params.id;
const {user} = UserSession();
const uid = user.uid;
const [label, setLabel] = useState([]);
const [expiry, setExpiry] = useState(false);
const [poll, setPoll] = useState(null);
const [modal, setModal] = useState(false);
const [pollData, setPollData] = useState([]);
const [index, setIndex] = useState(-1);
const handleURL = ()=>{
navigator.clipboard.writeText("https://insta-poll-72ce3.web.app/" + poll.id);
toast.success("URL copied to clipboard")
}
const showModal = () => {
setModal(!modal);
};
const handleClick = (index)=>{
setIndex(index);
let x = poll;
if(!x.votes[uid])
{
x.options.forEach((option)=>{
if(option.index==index)
option.count +=1;
})
}
else if(x.votes[uid]!=index)
{
x.options.forEach((option)=>{
if(option.index==(x.votes[uid]))
{
option.count-=1;
}
else if(option.index==index)
{
option.count+=1;
}
})
}
x.votes[uid] = index;
updatePoll(x);
}
const handleLogout = ()=>{
firebase.auth().signOut().then(function() {
}).catch(function(error) {
});
}
useEffect(()=>{
const docRef = firestore.doc(`/polls/${id}`);
const unsubscribe = docRef.onSnapshot((document)=>{
if(document.exists)
{ setPoll(document.data());
let x=[], y=[];
if(document.data().expire)
{
if((new Date().getTime()/1000)>=document.data().date.seconds)
setExpiry(true);
}
document.data().options.forEach((option)=>{
x.push(option.title);
y.push(option.count)
})
if(document.data().votes && document.data().votes[uid])
{
setIndex(document.data().votes[uid]);
}
setLabel(x);
setPollData(y);
}
else
{
props.history.push("/not_found");
}
})
}, [])
const shareUrl = 'http://github.com';
const data = {
labels :label,
datasets: [
{
label: 'Number of Votes',
data: pollData,
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)',
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)',
],
borderWidth: 1,
},
],
}
const options = {
scales: {
yAxes: [
{
ticks: {
beginAtZero: true,
precision:0,
fontFamily:"Mulish",
fontStyle: '500'
},
barPercentage:"0.4"
},
],
xAxes: [
{
ticks: {
beginAtZero: true,
precision:0,
fontFamily:"Mulish",
fontStyle:"500"
},
},
],
},
legend:{
labels:{
fontFamily: "Mulish"
},
},
maintainAspectRatio: false
}
if(!poll)
return( <div
style={{
width: "100%",
display: "flex",
height: "100vh",
alignItems: "center",
justifyContent: "center",
zIndex: "23444898429"
}}
>
<img src={Loader} />
</div>)
return (
<div>
<div className="logout_grid">
<div>
<h1 className="head_title animate__animated animate__fadeIn">{poll.title} </h1>
</div>
<div>
<Button type="primary" onClick={handleLogout} className="btn_logout"> Logout <LogoutOutlined /></Button>
</div>
</div>
<Link to="/"><Button type="primary" className="create_btn" >Create a new Poll</Button></Link>
<br/>
<ToastContainer newestOnTop autoClose={2000}/>
<div className="flex">
<div className="options_div animate__animated animate__fadeInLeft">
{expiry ? (<h2>This poll is no longer accepting responses ❌</h2>) : (<h2>Select an Option ?</h2>)}
{expiry ? (poll.options.map((option)=>{
if(option.index!=index)
return (
<div className="poll_live_expire">
{option.title}
</div>
)
else
return(
<div className="poll_live_expire_selected">
{option.title}
</div>
)
})) : (poll.options.map((option)=>
{
if(option.index!=index)
return(
<div className="poll_live" onClick={()=>handleClick(option.index)}>
{option.title}
</div>
)
else
return(
<div className="poll_live_selected " onClick={()=>handleClick(option.index)}>
{option.title}
</div>
)
}
))}
</div>
{index!=-1 && ( <div className="graph animate__animated animate__fadeInRight">
<HorizontalBar data={data} options={options} />
</div>)}
</div>
<div className="share_icons animate__animated animate__fadeIn">
<h3>Share this Poll <ShareAltOutlined /></h3>
<TwitterShareButton
url={`https://insta-poll-72ce3.web.app/${poll.id}`}
title={`Vote to this poll titled "${poll.title}" generated using Insta Poll\n`}
className="share_icon"
>
<TwitterIcon size={32} round />
</TwitterShareButton>
<WhatsappShareButton
url={`https://insta-poll-72ce3.web.app/${poll.id}`}
title={`Vote to this poll titled "${poll.title}" generated using Insta Poll`}
separator=":: "
className="share_icon"
>
<WhatsappIcon size={32} round />
</WhatsappShareButton>
<FacebookShareButton
url={`https://insta-poll-72ce3.web.app/${poll.id}`}
title={`Vote to this poll titled "${poll.title}" generated using Insta Poll`}
className="share_icon"
>
<FacebookIcon size={32} round />
</FacebookShareButton>
<br/>
<Input value={`https://insta-poll-72ce3.web.app/${poll.id}`} style={{width:"15rem"}} disabled/>
<Button type="primary" onClick={handleURL}>Copy URL</Button>
<Button type="primary" onClick={showModal} style={{margin:"0.5rem"}}>
Share QR Code
</Button>
<Modal
visible={modal}
onOk={showModal}
onCancel = {showModal}
style={{textAlign:"center"}}
>
<QRCode value={`https://insta-poll-72ce3.web.app/${poll.id}`} style={{height:"12rem", width:"12rem"}} />
</Modal>
</div>
</div>
)
}
Example #5
Source File: index.jsx From prometheusPro with MIT License | 4 votes |
Applications = props => {
const { list } = props;
const itemMenu = (
<Menu>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="https://www.alipay.com/">
1st menu item
</a>
</Menu.Item>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="https://www.taobao.com/">
2nd menu item
</a>
</Menu.Item>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="https://www.tmall.com/">
3d menu item
</a>
</Menu.Item>
</Menu>
);
const CardInfo = ({ activeUser, newUser }) => (
<div className={stylesApplications.cardInfo}>
<div>
<p>活跃用户</p>
<p>{activeUser}</p>
</div>
<div>
<p>新增用户</p>
<p>{newUser}</p>
</div>
</div>
);
return (
<List
rowKey="id"
className={stylesApplications.filterCardList}
grid={{
gutter: 24,
xxl: 3,
xl: 2,
lg: 2,
md: 2,
sm: 2,
xs: 1,
}}
dataSource={list}
renderItem={item => (
<List.Item key={item.id}>
<Card
hoverable
bodyStyle={{
paddingBottom: 20,
}}
actions={[
<Tooltip key="download" title="下载">
<DownloadOutlined />
</Tooltip>,
<Tooltip title="编辑" key="edit">
<EditOutlined />
</Tooltip>,
<Tooltip title="分享" key="share">
<ShareAltOutlined />
</Tooltip>,
<Dropdown overlay={itemMenu} key="ellipsis">
<EllipsisOutlined />
</Dropdown>,
]}
>
<Card.Meta avatar={<Avatar size="small" src={item.avatar} />} title={item.title} />
<div className={stylesApplications.cardItemContent}>
<CardInfo
activeUser={formatWan(item.activeUser)}
newUser={numeral(item.newUser).format('0,0')}
/>
</div>
</Card>
</List.Item>
)}
/>
);
}
Example #6
Source File: index.jsx From prometheusPro with MIT License | 4 votes |
render() {
const {
listAndsearchAndapplications: { list },
loading,
form,
} = this.props;
const { getFieldDecorator } = form;
const CardInfo = ({ activeUser, newUser }) => (
<div className={styles.cardInfo}>
<div>
<p>活跃用户</p>
<p>{activeUser}</p>
</div>
<div>
<p>新增用户</p>
<p>{newUser}</p>
</div>
</div>
);
const formItemLayout = {
wrapperCol: {
xs: {
span: 24,
},
sm: {
span: 16,
},
},
};
const itemMenu = (
<Menu>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="https://www.alipay.com/">
1st menu item
</a>
</Menu.Item>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="https://www.taobao.com/">
2nd menu item
</a>
</Menu.Item>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="https://www.tmall.com/">
3d menu item
</a>
</Menu.Item>
</Menu>
);
return (
<div className={styles.filterCardList}>
<Card bordered={false}>
<Form layout="inline">
<StandardFormRow
title="所属类目"
block
style={{
paddingBottom: 11,
}}
>
<FormItem>
{getFieldDecorator('category')(
<TagSelect expandable>
<TagSelect.Option value="cat1">类目一</TagSelect.Option>
<TagSelect.Option value="cat2">类目二</TagSelect.Option>
<TagSelect.Option value="cat3">类目三</TagSelect.Option>
<TagSelect.Option value="cat4">类目四</TagSelect.Option>
<TagSelect.Option value="cat5">类目五</TagSelect.Option>
<TagSelect.Option value="cat6">类目六</TagSelect.Option>
<TagSelect.Option value="cat7">类目七</TagSelect.Option>
<TagSelect.Option value="cat8">类目八</TagSelect.Option>
<TagSelect.Option value="cat9">类目九</TagSelect.Option>
<TagSelect.Option value="cat10">类目十</TagSelect.Option>
<TagSelect.Option value="cat11">类目十一</TagSelect.Option>
<TagSelect.Option value="cat12">类目十二</TagSelect.Option>
</TagSelect>,
)}
</FormItem>
</StandardFormRow>
<StandardFormRow title="其它选项" grid last>
<Row gutter={16}>
<Col lg={8} md={10} sm={10} xs={24}>
<FormItem {...formItemLayout} label="作者">
{getFieldDecorator(
'author',
{},
)(
<Select
placeholder="不限"
style={{
maxWidth: 200,
width: '100%',
}}
>
<Option value="lisa">王昭君</Option>
</Select>,
)}
</FormItem>
</Col>
<Col lg={8} md={10} sm={10} xs={24}>
<FormItem {...formItemLayout} label="好评度">
{getFieldDecorator(
'rate',
{},
)(
<Select
placeholder="不限"
style={{
maxWidth: 200,
width: '100%',
}}
>
<Option value="good">优秀</Option>
<Option value="normal">普通</Option>
</Select>,
)}
</FormItem>
</Col>
</Row>
</StandardFormRow>
</Form>
</Card>
<br />
<List
rowKey="id"
grid={{
gutter: 24,
xl: 4,
lg: 3,
md: 3,
sm: 2,
xs: 1,
}}
loading={loading}
dataSource={list}
renderItem={item => (
<List.Item key={item.id}>
<Card
hoverable
bodyStyle={{
paddingBottom: 20,
}}
actions={[
<Tooltip key="download" title="下载">
<DownloadOutlined />
</Tooltip>,
<Tooltip key="edit" title="编辑">
<EditOutlined />
</Tooltip>,
<Tooltip title="分享" key="share">
<ShareAltOutlined />
</Tooltip>,
<Dropdown key="ellipsis" overlay={itemMenu}>
<EllipsisOutlined />
</Dropdown>,
]}
>
<Card.Meta avatar={<Avatar size="small" src={item.avatar} />} title={item.title} />
<div className={styles.cardItemContent}>
<CardInfo
activeUser={formatWan(item.activeUser)}
newUser={numeral(item.newUser).format('0,0')}
/>
</div>
</Card>
</List.Item>
)}
/>
</div>
);
}