@@ -18,7 +18,7 @@ import { CloseOutline } from '@kyper/icon/CloseOutline'
1818import { Search as SearchIcon } from '@kyper/icon/Search'
1919import InputAdornment from '@mui/material/InputAdornment'
2020import { TextField } from 'src/privacy/input'
21- import { IconButton } from '@mui/material'
21+ import { IconButton , Snackbar } from '@mui/material'
2222
2323import { __ } from 'src/utilities/Intl'
2424import * as connectActions from 'src/redux/actions/Connect'
@@ -62,20 +62,6 @@ export const initialState = {
6262
6363const MAX_SUGGESTED_LIST_SIZE = 25
6464
65- const getVersionLabel = ( version ) => {
66- // Check for SHA pattern
67- if ( typeof version === 'string' && / ^ [ 0 - 9 a - f ] { 7 , 40 } $ / i. test ( version ) ) {
68- return `v.${ version . slice ( 0 , 7 ) } `
69- }
70-
71- // Trim a string that isn't a SHA pattern
72- if ( typeof version === 'string' && version . trim ( ) !== '' ) {
73- return `v.${ version . trim ( ) } `
74- }
75-
76- return ''
77- }
78-
7965const reducer = ( state , action ) => {
8066 switch ( action . type ) {
8167 case SEARCH_ACTIONS . LOAD_SUCCESS :
@@ -172,7 +158,6 @@ export const Search = React.forwardRef((_, navigationRef) => {
172158
173159 const MINIMUM_SEARCH_LENGTH = 2
174160 const isFirstTimeUser = connectedMembers . length === 0
175- const versionLabel = getVersionLabel ( widgetVersion )
176161
177162 useImperativeHandle ( navigationRef , ( ) => {
178163 return {
@@ -358,11 +343,12 @@ export const Search = React.forwardRef((_, navigationRef) => {
358343 { __ ( 'Select your institution' ) }
359344 </ Text >
360345 { /* This version is a hidden feature unless a user is told how to find it */ }
361- { headerClicks >= 5 && versionLabel && (
362- < Text data-test = "search-version-label" style = { inlineStyles . version } >
363- { versionLabel }
364- </ Text >
365- ) }
346+ < Snackbar
347+ autoHideDuration = { 6000 }
348+ message = { widgetVersion }
349+ onClose = { ( ) => setHeaderClicks ( 0 ) }
350+ open = { headerClicks >= 5 && Boolean ( widgetVersion ) }
351+ />
366352 < TextField
367353 InputProps = { {
368354 startAdornment : (
0 commit comments