forked from prefeiturasp/SME-FilaDaCreche
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is intended two remove duplicate code between the `RegistrationList` and the `SchoolList` components, as requested by prefeiturasp#11. [Here](http://filadacreche.sme.prefeitura.sp.gov.br/#/resultados/28/-46.793739000000016/-23.6862114/R.%20Feiti%C3%A7o%20da%20Vila,%20399%20-%20Chacara%20Santa%20Maria,%20S%C3%A3o%20Paulo%20-%20SP,%2005879-000,%20Brasil) is an example of SchoolList being used. If you click "Cadastrar na fila" at the bottom part of the page, you will reach a page where RegistrationList is used. Neither of those should break after this change, they should look exactly the same as before.
- Loading branch information
1 parent
ed66791
commit d733308
Showing
3 changed files
with
38 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import STRINGS from 'configs/Strings'; | ||
import GLOBALS from 'configs/MainConfigs'; | ||
|
||
import fontawesome from '@fortawesome/fontawesome' | ||
import FontAwesomeIcon from '@fortawesome/react-fontawesome' | ||
import faPhone from '@fortawesome/fontawesome-free-solid/faPhone' | ||
import faMapMarkerAlt from '@fortawesome/fontawesome-free-solid/faMapMarkerAlt' | ||
|
||
fontawesome.library.add(faPhone, faMapMarkerAlt) | ||
|
||
const SchoolContact = ({school}) => ( | ||
<React.Fragment> | ||
{school.telefones && <div className="icon-div"> | ||
<a href={"tel:" + school.telefones[0]}> | ||
<p className="text-center"><FontAwesomeIcon icon="phone" size="lg" className="icons icons-lg" /><br />{STRINGS.actions.call}</p> | ||
</a> | ||
</div>} | ||
<div className="icons-div"> | ||
<a href={"https://www.google.com/maps/search/?api=1&query=" + school.endereco_completo + " " + GLOBALS.city_state} target="_blank"> | ||
<p className="text-center"><FontAwesomeIcon icon="map-marker-alt" size="lg" className="icons icons-lg" /><br />{STRINGS.actions.see_on_map}</p> | ||
</a> | ||
</div> | ||
</React.Fragment> | ||
); | ||
|
||
SchoolContact.propTypes = { | ||
school: PropTypes.object | ||
}; | ||
|
||
export { SchoolContact }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters