This file contains hidden or 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
import React, { useState } from "react"; | |
import { showToast } from "@openmrs/esm-framework"; | |
import { Column, Dropdown } from "carbon-components-react"; | |
import { useLocations } from ".resources"; | |
const SearchByEncounters: React.FC = () => { | |
const { locations, error, isLoading } = useLocations(); |
This file contains hidden or 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
import { openmrsFetch, FetchResponse } from "@openmrs/esm-framework"; | |
import useSWR from 'swr'; | |
import { Location, Response } from "./types"; | |
export const useLocations = () => { | |
const { data, error } = useSWR<{ | |
data: { results: Response[] }; | |
}>("/ws/rest/v1/location", openmrsFetch); |
This file contains hidden or 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
sendEmail = (e) => { | |
e.preventDefault(); | |
emailjs.sendForm('YOUR_EMAIL_SERVICE_NAME', 'YOUR_EMAIL_TEMPLATE_NAME', e.target, 'YOUR_USER_ID') | |
.then((result) => { | |
this.setState({isAlertVisible: true}) | |
}, (error) => { | |
console.log(error.text); | |
}); | |
} | |
This file contains hidden or 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
<form className="php-email-form" onSubmit={this.sendEmail}> | |
<div className="form-row"> | |
<div className="col-md-6 form-group"> | |
<input required={true} type="text" name="name" className="form-control" placeholder="Your Name"/> | |
</div> | |
<div className="col-md-6 form-group"> | |
<input required={true} type="email" className="form-control" name="email" | |
placeholder="Your Email"/> | |
</div> | |
</div> |
This file contains hidden or 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
var map = L.map('map').setView([51.505, -0.09], 13); | |
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | |
}).addTo(map); | |
L.marker([51.5, -0.09]).addTo(map) | |
.bindPopup('A pretty CSS3 popup.<br> Easily customizable.') | |
.openPopup(); |