@@ -4,6 +4,7 @@ import { nanoid } from 'nanoid';
44import { useEffect , useState } from 'react' ;
55import { Link } from 'react-router'
66import { Iversion } from '../assets/js/mytypes' ;
7+ import { isLegacyVersion } from '../assets/js/helper' ;
78
89type arg = { name : string ; desc : string }
910type object_list = {
@@ -17,7 +18,7 @@ interface IReferencePage {
1718 HANDLER_METHODS : object_list [ ] ;
1819 STYLE_ATTRIBUTES : object_list [ ] ;
1920}
20- export default function ReferencePage ( { version } : { version :Iversion } ) {
21+ export default function ReferencePage ( { version } : { version : Iversion } ) {
2122 const [ data , setData ] = useState < IReferencePage > ( )
2223
2324 async function changeVersionData ( version : Iversion ) {
@@ -59,10 +60,10 @@ export default function ReferencePage({ version }: { version:Iversion}) {
5960 < h2 > For v1.59</ h2 >
6061 < p className = 'paragraph' > Add methods working to free up __init__ kwargs [parsing out `style` attribute] </ p >
6162 < div className = 'paragraph' >
62- < span className = "cod paragraph" > setSmallIcon</ span > == < span className = "code yellow-shade" > Notification(..., app_icon="...") </ span > < br /> < br />
63- < span > setLargeIcon</ span > == < span className = "code yellow-shade" > Notification(..., large_icon_path="...", style=NotificationStyles.LARGE_ICON)</ span > < br /> < br />
64- < span > setBigPicture</ span > == < span className = "code yellow-shade" > Notification(..., big_picture_path="...",style=NotificationStyles.BIG_PICTURE)</ span > < br /> < br />
65- < span > setBigText</ span > == < span className = "code yellow-shade" > Notification(..., body="...", style=NotificationStyles.BIG_TEXT)</ span > < br />
63+ < span className = "cod paragraph" > setSmallIcon</ span > == < span className = "code yellow-shade" > Notification(..., app_icon="...") </ span > < br /> < br />
64+ < span > setLargeIcon</ span > == < span className = "code yellow-shade" > Notification(..., large_icon_path="...", style=NotificationStyles.LARGE_ICON)</ span > < br /> < br />
65+ < span > setBigPicture</ span > == < span className = "code yellow-shade" > Notification(..., big_picture_path="...",style=NotificationStyles.BIG_PICTURE)</ span > < br /> < br />
66+ < span > setBigText</ span > == < span className = "code yellow-shade" > Notification(..., body="...", style=NotificationStyles.BIG_TEXT)</ span > < br />
6667 </ div >
6768 </ section > }
6869 { /* Instance Methods Section */ }
@@ -106,7 +107,25 @@ export default function ReferencePage({ version }: { version:Iversion}) {
106107 </ section >
107108
108109 < section id = "notificationstyles-class" className = "space-y-6 page-section" tabIndex = { 0 } >
109- < h2 className = "text-xl font-bold" > NotificationStyles attributes for Safely Adding Styles</ h2 >
110+ { isLegacyVersion ( version ) ?
111+ < h2 className = "text-xl font-bold" > NotificationStyles attributes for Safely Adding Styles</ h2 >
112+ :
113+ < >
114+ < h2 className = "text-xl font-bold" > NotificationStyles</ h2 >
115+ < p className = "paragraph" >
116+ Most of NotificationStyles attributes are deprecated in v1.59 except < span className = 'code green' > NotificationStyles.INBOX</ span > , but they're still available for backward compatibility.
117+ You can use the < span className = "code yellow-shade" > style</ span > attribute in the Notification class to set styles.</ p >
118+ < p > For example:</ p >
119+ < p > Notification.setLargeIcon('profile.png') replaced</ p >
120+ < p className = "paragraph inner-section-2" >
121+ < span className = "code yellow-shade" > Notification(..., large_icon_path="profile.png", style=NotificationStyles.LARGE_ICON)</ span >
122+ </ p >
123+ < p className = "paragraph" >
124+ You can also use the < span className = "code yellow-shade" > setLargeIcon</ span > , < span className = "code yellow-shade" > setBigPicture</ span > , and < span className = "code yellow-shade" > setBigText</ span >
125+ methods to set the respective styles of < span className = "code" > NotificationStyles.LARGE_ICON</ span > , < span className = "code" > NotificationStyles.BIG_PICTURE</ span > , < span className = "code" > NotificationStyles.BIG_TEXT</ span >
126+ </ p >
127+ </ >
128+ }
110129 < div className = 'flex flex-wrap align-items-cen justify-content-cen styles-container' >
111130
112131 { data ?. STYLE_ATTRIBUTES . map ( ( m ) => (
0 commit comments