Skip to content

Commit

Permalink
Show email buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
gocemitevski committed Jan 26, 2024
1 parent 347f5d8 commit 9faf0b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/components/SchoolItem.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import React from 'react';
import SchoolItemLink from './SchoolItemLink';
// import Mail from './Mail';
import Mail from './Mail';

const SchoolItem = (props) => {

// const emails = props.data[5].split(/[\s|,|;]/);
const emails = props.data.email.split(/[\s|,|;]/);

return (
<article className="card school" key={props.index}>
<div className="row no-gutters">
<div className="col-lg-6 p-4 d-flex flex-column">
<h2 className={`h5 flex-fill ${props.data.tip ? `mb-2` : `mb-0`}`}>
<h2 className={`h5 ${props.data.tip ? `mb-2` : `mb-0`}`}>
<SchoolItemLink {...props} data={props.data} />
</h2>
{props.data.tip && <p className='text-muted'>{props.data.tip}</p>}
{props.data.tip && <p className='text-muted flex-fill'>{props.data.tip}</p>}
</div>
<div className="col-lg-6">
<div className="card-body">
<dl className="mb-0">
<dt>Адреса:</dt>
<dd><address className="mb-0">{props.data.adresa}<br />{props.data.opstina}</address></dd>
</dl>
{/* {emails.length > 0 && <ul className="list-inline mt-3 mb-0">{emails.map((item, key) => <Mail key={key} props={item} />)}</ul>} */}
{emails.length > 0 && <ul className="list-inline mt-3 mb-0">{emails.map((item, key) => item && <Mail key={key} props={item} />)}</ul>}
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/SchoolItemMap.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import SchoolMap from './SchoolMap';
// import Mail from './Mail';
import Mail from './Mail';
import NoMap from './NoMap';

const SchoolItemMap = (props) => {

// const emails = props.data[5].split(/[\s|,|;]/);
const emails = props.data.email.split(/[\s|,|;]/);
const { position } = props;


Expand All @@ -19,11 +19,11 @@ const SchoolItemMap = (props) => {
<div className="card-body p-5 d-flex flex-column h-100">
<h1 className="h2 mb-3 font-weight-bold card-title">{props.data.ime}</h1>
{props.data.tip && <p className='text-muted'>{props.data.tip}</p>}
<dl className="mb-0">
<dl className="mb-0 flex-fill">
<dt>Адреса:</dt>
<dd><address className="mb-0">{props.data.adresa}<br />{props.data.opstina}</address></dd>
</dl>
{/* {emails.length > 0 && <ul className="list-inline mb-0 mt-auto">{emails.map((item, key) => <Mail key={key} props={item} />)}</ul>} */}
{emails.length > 0 && <ul className="list-inline mb-0">{emails.map((item, key) => item && <Mail key={key} props={item} />)}</ul>}
</div>
</div>
</div>
Expand Down

0 comments on commit 9faf0b7

Please sign in to comment.