-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into templates-copy
- Loading branch information
Showing
16 changed files
with
554 additions
and
254 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
26 changes: 26 additions & 0 deletions
26
.../Chat/ChatMessages/ChatMessage/LocationRequestTemplate/LocationRequestTemplate.module.css
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,26 @@ | ||
.MessageContent { | ||
max-width: 100%; | ||
border-radius: 12px 12px 0px 0px; | ||
font-family: 'Heebo', sans-serif, emoji; | ||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); | ||
clear: both; | ||
max-width: 404px; | ||
min-width: 85px; | ||
padding: 10px; | ||
background: white; | ||
border-bottom: 1px solid rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.SimulatorButton { | ||
width: 100%; | ||
text-transform: none !important; | ||
border-radius: 0px 0px 15px 15px !important; | ||
background: white !important; | ||
border: 1px solid rgba(0, 0, 0, 0.1) !important; | ||
border-top: none !important | ||
} | ||
|
||
.ChatButton { | ||
composes: SimulatorButton; | ||
padding: 5px 20px !important; | ||
} |
48 changes: 48 additions & 0 deletions
48
...tainers/Chat/ChatMessages/ChatMessage/LocationRequestTemplate/LocationRequestTemplate.tsx
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,48 @@ | ||
import { Button } from '@mui/material'; | ||
import LocationIconDark from 'assets/images/icons/Location/Dark.svg?react'; | ||
import styles from './LocationRequestTemplate.module.css'; | ||
import { ChatMessageType } from '../ChatMessageType/ChatMessageType'; | ||
|
||
export interface LocationRequestTemplateProps { | ||
content: any; | ||
disabled?: boolean; | ||
|
||
isSimulator?: boolean; | ||
onSendLocationClick?: any; | ||
} | ||
|
||
const locationPayload = { | ||
type: 'location', | ||
name: 'location', | ||
id: 'LOCATION', | ||
payload: { | ||
latitude: '41.725556', | ||
longitude: '-49.946944', | ||
}, | ||
}; | ||
|
||
export const LocationRequestTemplate = ({ | ||
content, | ||
disabled = false, | ||
isSimulator = false, | ||
|
||
onSendLocationClick = () => {}, | ||
}: LocationRequestTemplateProps) => { | ||
const body = content.body.text; | ||
return ( | ||
<div> | ||
<div className={styles.MessageContent}> | ||
<ChatMessageType type="TEXT" body={body} isSimulatedMessage={isSimulator} /> | ||
</div> | ||
<Button | ||
variant="text" | ||
disabled={disabled} | ||
startIcon={<LocationIconDark />} | ||
onClick={() => onSendLocationClick({ payload: locationPayload })} | ||
className={isSimulator ? styles.SimulatorButton : styles.ChatButton} | ||
> | ||
Send Location | ||
</Button> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.