[feature] add block user feature in user profile
- add block/unblock action to user profile - blocking deletes all messages from user and ignores future messages - unblocking stops ignoring new messages from user but doesn't recover past ones [feature] add contact list [tests] added scroll to BackupRecoveryPhraseButton [tests] added scroll to public key Signed-off-by: yenda <eric@status.im>
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
|
||||
<path fill="" fill-rule="evenodd" d="M13.5416667,11.4583333 L13.5416667,6.2571307 C13.5416667,5.67702996 13.0752966,5.20833333 12.5,5.20833333 C11.9206925,5.20833333 11.4583333,5.67789591 11.4583333,6.2571307 L11.4583333,11.4583333 L6.2571307,11.4583333 C5.67702996,11.4583333 5.20833333,11.9247034 5.20833333,12.5 C5.20833333,13.0793075 5.67789591,13.5416667 6.2571307,13.5416667 L11.4583333,13.5416667 L11.4583333,18.7428693 C11.4583333,19.32297 11.9247034,19.7916667 12.5,19.7916667 C13.0793075,19.7916667 13.5416667,19.3221041 13.5416667,18.7428693 L13.5416667,13.5416667 L18.7428693,13.5416667 C19.32297,13.5416667 19.7916667,13.0752966 19.7916667,12.5 C19.7916667,11.9206925 19.3221041,11.4583333 18.7428693,11.4583333 L13.5416667,11.4583333 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 846 B |
|
@ -1,5 +1,5 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="" fill-rule="nonzero" d="M16.09 19.727v-1.636a4.273 4.273 0 0 0-4.272-4.273H5.273A4.273 4.273 0 0 0 1 18.091v1.636a1 1 0 1 0 2 0v-1.636a2.273 2.273 0 0 1 2.273-2.273h6.545a2.273 2.273 0 0 1 2.273 2.273v1.636a1 1 0 1 0 2 0zm-7.545-9.182a2.273 2.273 0 1 0 0-4.545 2.273 2.273 0 0 0 0 4.545zM18 11V9.003c0-.554.647-1.003.926-1.003.276 0 .989.438.989 1.003V11h1.78a.999.999 0 0 1 1.002 1c0 .552-.438 1-1.003 1h-1.78v2c0 .554-.71 1.003-.988 1.003-.277 0-.926-.438-.926-1.003v-2h-1.997A.999.999 0 0 1 15 12c0-.552.438-1 1.003-1H18zm-9.455 1.545a4.273 4.273 0 1 1 0-8.545 4.273 4.273 0 0 1 0 8.545z"/>
|
||||
<g fill="" fill-rule="evenodd">
|
||||
<path fill="" fill-rule="evenodd" d="M16.09 19.727v-1.636a4.273 4.273 0 0 0-4.272-4.273H5.273A4.273 4.273 0 0 0 1 18.091v1.636a1 1 0 1 0 2 0v-1.636a2.273 2.273 0 0 1 2.273-2.273h6.545a2.273 2.273 0 0 1 2.273 2.273v1.636a1 1 0 1 0 2 0zm-7.545-9.182a2.273 2.273 0 1 0 0-4.545 2.273 2.273 0 0 0 0 4.545zM18 11V9.003c0-.554.647-1.003.926-1.003.276 0 .989.438.989 1.003V11h1.78a.999.999 0 0 1 1.002 1c0 .552-.438 1-1.003 1h-1.78v2c0 .554-.71 1.003-.988 1.003-.277 0-.926-.438-.926-1.003v-2h-1.997A.999.999 0 0 1 15 12c0-.552.438-1 1.003-1H18zm-9.455 1.545a4.273 4.273 0 1 1 0-8.545 4.273 4.273 0 0 1 0 8.545z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 755 B After Width: | Height: | Size: 751 B |
|
@ -1,6 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<g fill="#4360DF" fill-rule="evenodd">
|
||||
<path d="M6 15L13 15 13 15C14.6568542 15 16 16.3431458 16 18L16 20.7000008 3 20.7000008 3 18 3 18C3 16.3431458 4.34314575 15 6 15zM9.54545455 10.5454545C10.8006472 10.5454545 11.8181818 9.52791989 11.8181818 8.27272727 11.8181818 7.01753466 10.8006472 6 9.54545455 6 8.29026193 6 7.27272727 7.01753466 7.27272727 8.27272727 7.27272727 9.52791989 8.29026193 10.5454545 9.54545455 10.5454545z" opacity=".12"/>
|
||||
<path fill-rule="nonzero" d="M17.0909091,19.7272727 L17.0909091,18.0909091 C17.0909091,15.731147 15.1779439,13.8181818 12.8181818,13.8181818 L6.27272727,13.8181818 C3.91296516,13.8181818 2,15.731147 2,18.0909091 L2,19.7272727 C2,20.2795575 2.44771525,20.7272727 3,20.7272727 C3.55228475,20.7272727 4,20.2795575 4,19.7272727 L4,18.0909091 C4,16.8357165 5.01753466,15.8181818 6.27272727,15.8181818 L12.8181818,15.8181818 C14.0733744,15.8181818 15.0909091,16.8357165 15.0909091,18.0909091 L15.0909091,19.7272727 C15.0909091,20.2795575 15.5386243,20.7272727 16.0909091,20.7272727 C16.6431938,20.7272727 17.0909091,20.2795575 17.0909091,19.7272727 Z M9.54545455,12.5454545 C7.18569243,12.5454545 5.27272727,10.6324894 5.27272727,8.27272727 C5.27272727,5.91296516 7.18569243,4 9.54545455,4 C11.9052167,4 13.8181818,5.91296516 13.8181818,8.27272727 C13.8181818,10.6324894 11.9052167,12.5454545 9.54545455,12.5454545 Z M9.54545455,10.5454545 C10.8006472,10.5454545 11.8181818,9.52791989 11.8181818,8.27272727 C11.8181818,7.01753466 10.8006472,6 9.54545455,6 C8.29026193,6 7.27272727,7.01753466 7.27272727,8.27272727 C7.27272727,9.52791989 8.29026193,10.5454545 9.54545455,10.5454545 Z M22,19.7272727 L22,18.0909091 C21.9985473,16.1429935 20.6807939,14.4430916 18.7954543,13.9562995 C18.2607068,13.8182285 17.7152797,14.1397983 17.5772086,14.6745457 C17.4391376,15.2092932 17.7607074,15.7547203 18.2954548,15.8927914 C19.298295,16.1517233 19.9992277,17.0559264 20.0000003,18.091655 L20,19.7272727 C20,20.2795575 20.4477153,20.7272727 21,20.7272727 C21.5522847,20.7272727 22,20.2795575 22,19.7272727 Z M15.0246881,6.07511364 C16.0303215,6.33259647 16.7336899,7.23874497 16.7336899,8.27681818 C16.7336899,9.31489139 16.0303215,10.2210399 15.0246881,10.4785227 C14.4896622,10.615511 14.166989,11.1602861 14.3039773,11.6953119 C14.4409655,12.2303378 14.9857406,12.553011 15.5207665,12.4160227 C17.4113573,11.931955 18.7336899,10.2283958 18.7336899,8.27681818 C18.7336899,6.32524054 17.4113573,4.62168136 15.5207665,4.13761364 C14.9857406,4.00062538 14.4409655,4.3232986 14.3039773,4.85832445 C14.166989,5.3933503 14.4896622,5.93812538 15.0246881,6.07511364 Z"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.6 KiB |
|
@ -1,3 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path fill="#939BA1" d="M17.0909091,19.7272727 L17.0909091,18.0909091 C17.0909091,15.731147 15.1779439,13.8181818 12.8181818,13.8181818 L6.27272727,13.8181818 C3.91296516,13.8181818 2,15.731147 2,18.0909091 L2,19.7272727 C2,20.2795575 2.44771525,20.7272727 3,20.7272727 C3.55228475,20.7272727 4,20.2795575 4,19.7272727 L4,18.0909091 C4,16.8357165 5.01753466,15.8181818 6.27272727,15.8181818 L12.8181818,15.8181818 C14.0733744,15.8181818 15.0909091,16.8357165 15.0909091,18.0909091 L15.0909091,19.7272727 C15.0909091,20.2795575 15.5386243,20.7272727 16.0909091,20.7272727 C16.6431938,20.7272727 17.0909091,20.2795575 17.0909091,19.7272727 Z M9.54545455,12.5454545 C7.18569243,12.5454545 5.27272727,10.6324894 5.27272727,8.27272727 C5.27272727,5.91296516 7.18569243,4 9.54545455,4 C11.9052167,4 13.8181818,5.91296516 13.8181818,8.27272727 C13.8181818,10.6324894 11.9052167,12.5454545 9.54545455,12.5454545 Z M9.54545455,10.5454545 C10.8006472,10.5454545 11.8181818,9.52791989 11.8181818,8.27272727 C11.8181818,7.01753466 10.8006472,6 9.54545455,6 C8.29026193,6 7.27272727,7.01753466 7.27272727,8.27272727 C7.27272727,9.52791989 8.29026193,10.5454545 9.54545455,10.5454545 Z M22,19.7272727 L22,18.0909091 C21.9985473,16.1429935 20.6807939,14.4430916 18.7954543,13.9562995 C18.2607068,13.8182285 17.7152797,14.1397983 17.5772086,14.6745457 C17.4391376,15.2092932 17.7607074,15.7547203 18.2954548,15.8927914 C19.298295,16.1517233 19.9992277,17.0559264 20.0000003,18.091655 L20,19.7272727 C20,20.2795575 20.4477153,20.7272727 21,20.7272727 C21.5522847,20.7272727 22,20.2795575 22,19.7272727 Z M15.0246881,6.07511364 C16.0303215,6.33259647 16.7336899,7.23874497 16.7336899,8.27681818 C16.7336899,9.31489139 16.0303215,10.2210399 15.0246881,10.4785227 C14.4896622,10.615511 14.166989,11.1602861 14.3039773,11.6953119 C14.4409655,12.2303378 14.9857406,12.553011 15.5207665,12.4160227 C17.4113573,11.931955 18.7336899,10.2283958 18.7336899,8.27681818 C18.7336899,6.32524054 17.4113573,4.62168136 15.5207665,4.13761364 C14.9857406,4.00062538 14.4409655,4.3232986 14.3039773,4.85832445 C14.166989,5.3933503 14.4896622,5.93812538 15.0246881,6.07511364 Z"/>
|
||||
<path fill="" d="M17.0909091,19.7272727 L17.0909091,18.0909091 C17.0909091,15.731147 15.1779439,13.8181818 12.8181818,13.8181818 L6.27272727,13.8181818 C3.91296516,13.8181818 2,15.731147 2,18.0909091 L2,19.7272727 C2,20.2795575 2.44771525,20.7272727 3,20.7272727 C3.55228475,20.7272727 4,20.2795575 4,19.7272727 L4,18.0909091 C4,16.8357165 5.01753466,15.8181818 6.27272727,15.8181818 L12.8181818,15.8181818 C14.0733744,15.8181818 15.0909091,16.8357165 15.0909091,18.0909091 L15.0909091,19.7272727 C15.0909091,20.2795575 15.5386243,20.7272727 16.0909091,20.7272727 C16.6431938,20.7272727 17.0909091,20.2795575 17.0909091,19.7272727 Z M9.54545455,12.5454545 C7.18569243,12.5454545 5.27272727,10.6324894 5.27272727,8.27272727 C5.27272727,5.91296516 7.18569243,4 9.54545455,4 C11.9052167,4 13.8181818,5.91296516 13.8181818,8.27272727 C13.8181818,10.6324894 11.9052167,12.5454545 9.54545455,12.5454545 Z M9.54545455,10.5454545 C10.8006472,10.5454545 11.8181818,9.52791989 11.8181818,8.27272727 C11.8181818,7.01753466 10.8006472,6 9.54545455,6 C8.29026193,6 7.27272727,7.01753466 7.27272727,8.27272727 C7.27272727,9.52791989 8.29026193,10.5454545 9.54545455,10.5454545 Z M22,19.7272727 L22,18.0909091 C21.9985473,16.1429935 20.6807939,14.4430916 18.7954543,13.9562995 C18.2607068,13.8182285 17.7152797,14.1397983 17.5772086,14.6745457 C17.4391376,15.2092932 17.7607074,15.7547203 18.2954548,15.8927914 C19.298295,16.1517233 19.9992277,17.0559264 20.0000003,18.091655 L20,19.7272727 C20,20.2795575 20.4477153,20.7272727 21,20.7272727 C21.5522847,20.7272727 22,20.2795575 22,19.7272727 Z M15.0246881,6.07511364 C16.0303215,6.33259647 16.7336899,7.23874497 16.7336899,8.27681818 C16.7336899,9.31489139 16.0303215,10.2210399 15.0246881,10.4785227 C14.4896622,10.615511 14.166989,11.1602861 14.3039773,11.6953119 C14.4409655,12.2303378 14.9857406,12.553011 15.5207665,12.4160227 C17.4113573,11.931955 18.7336899,10.2283958 18.7336899,8.27681818 C18.7336899,6.32524054 17.4113573,4.62168136 15.5207665,4.13761364 C14.9857406,4.00062538 14.4409655,4.3232986 14.3039773,4.85832445 C14.166989,5.3933503 14.4896622,5.93812538 15.0246881,6.07511364 Z"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 4C6.34315 4 5 5.34315 5 7C5 8.65685 6.34315 10 8 10C9.65685 10 11 8.65685 11 7C11 5.34315 9.65685 4 8 4ZM3 7C3 4.23858 5.23858 2 8 2C10.7614 2 13 4.23858 13 7C13 9.76142 10.7614 12 8 12C5.23858 12 3 9.76142 3 7ZM5 16C3.89543 16 3 16.8954 3 18V20C3 20.5523 2.55228 21 2 21C1.44772 21 1 20.5523 1 20V18C1 15.7909 2.79086 14 5 14H11C13.2091 14 15 15.7909 15 18V20C15 20.5523 14.5523 21 14 21C13.4477 21 13 20.5523 13 20V18C13 16.8954 12.1046 16 11 16H5Z M22.7071 8.29289C23.0976 8.68342 23.0976 9.31658 22.7071 9.70711L18.7071 13.7071C18.3166 14.0976 17.6834 14.0976 17.2929 13.7071L15.2929 11.7071C14.9024 11.3166 14.9024 10.6834 15.2929 10.2929C15.6834 9.90237 16.3166 9.90237 16.7071 10.2929L18 11.5858L21.2929 8.29289C21.6834 7.90237 22.3166 7.90237 22.7071 8.29289Z" fill=""/>
|
||||
</svg>
|
After Width: | Height: | Size: 930 B |
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path fill="" d="M7.5,9.5 C8.32842712,9.5 9,8.82842712 9,8 C9,7.17157288 8.32842712,6.5 7.5,6.5 C6.67157288,6.5 6,7.17157288 6,8 C6,8.82842712 6.67157288,9.5 7.5,9.5 Z M7.5,11.5 C5.56700338,11.5 4,9.93299662 4,8 C4,6.06700338 5.56700338,4.5 7.5,4.5 C9.43299662,4.5 11,6.06700338 11,8 C11,9.93299662 9.43299662,11.5 7.5,11.5 Z M7.30534261,15.50123 C7.60553658,14.7750004 7.99092707,14.11609 8.46270768,13.5324596 C8.15749779,13.5110937 7.83685516,13.5 7.49999931,13.5 C0.5,13.5 0.799121209,18.5314815 0.799121209,18.5314815 C0.577268533,19.6134452 1.39805342,20.5 2.50585846,20.5 L6.49999966,20.5 L6.50000034,20.4988391 C6.50044281,19.7352007 6.51905355,19.0944961 6.57578609,18.5 L2.63008884,18.5 C2.65747759,18.3579041 2.69020457,18.2190515 2.72916438,18.0777206 C3.18168192,16.4361646 4.36934114,15.5387986 7.30534261,15.50123 L7.30534261,15.50123 Z M16,10.5 C14.0670034,10.5 12.5,8.93299662 12.5,7 C12.5,5.06700338 14.0670034,3.5 16,3.5 C17.9329966,3.5 19.5,5.06700338 19.5,7 C19.5,8.93299662 17.9329966,10.5 16,10.5 Z M23.2443899,18.5224714 C23.3855587,19.6146303 22.6066014,20.5 21.5081146,20.5 L10.491884,20.5 C9.39179685,20.5 8.5665532,19.6132936 8.75560868,18.5224714 C8.75560868,18.5224714 8.5,12.5 15.9999993,12.5 C23.4999986,12.5 23.2443899,18.5224714 23.2443899,18.5224714 Z M21.1685339,17.5066793 C20.5722106,15.5582218 19.1598905,14.5 15.9999993,14.5 C12.8401579,14.5 11.4278315,15.5582157 10.8314887,17.5066493 C10.7304447,17.8367908 10.6582857,18.1561625 10.6076654,18.5000002 L21.3923408,18.5000015 C21.3417241,18.1561731 21.2695704,17.8368109 21.1685339,17.5066793 Z M16,8.5 C16.8284271,8.5 17.5,7.82842712 17.5,7 C17.5,6.17157288 16.8284271,5.5 16,5.5 C15.1715729,5.5 14.5,6.17157288 14.5,7 C14.5,7.82842712 15.1715729,8.5 16,8.5 Z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.8 KiB |
|
@ -1,5 +1,5 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="" fill-rule="nonzero" d="M16.09 19.727v-1.636a4.273 4.273 0 0 0-4.272-4.273H5.273A4.273 4.273 0 0 0 1 18.091v1.636a1 1 0 1 0 2 0v-1.636a2.273 2.273 0 0 1 2.273-2.273h6.545a2.273 2.273 0 0 1 2.273 2.273v1.636a1 1 0 1 0 2 0zm-7.545-9.182a2.273 2.273 0 1 0 0-4.545 2.273 2.273 0 0 0 0 4.545zm8.38 1.115l4.368-4.367a1 1 0 0 1 1.414 1.414L17.716 13.7a1 1 0 0 1-1.35.075l-2.49-1.993a1 1 0 1 1 1.249-1.562l1.8 1.441zm-8.38.885a4.273 4.273 0 1 1 0-8.545 4.273 4.273 0 0 1 0 8.545z"/>
|
||||
<g fill="" fill-rule="evenodd">
|
||||
<path fill="" fill-rule="evenodd" d="M16.09 19.727v-1.636a4.273 4.273 0 0 0-4.272-4.273H5.273A4.273 4.273 0 0 0 1 18.091v1.636a1 1 0 1 0 2 0v-1.636a2.273 2.273 0 0 1 2.273-2.273h6.545a2.273 2.273 0 0 1 2.273 2.273v1.636a1 1 0 1 0 2 0zm-7.545-9.182a2.273 2.273 0 1 0 0-4.545 2.273 2.273 0 0 0 0 4.545zm8.38 1.115l4.368-4.367a1 1 0 0 1 1.414 1.414L17.716 13.7a1 1 0 0 1-1.35.075l-2.49-1.993a1 1 0 1 1 1.249-1.562l1.8 1.441zm-8.38.885a4.273 4.273 0 1 1 0-8.545 4.273 4.273 0 0 1 0 8.545z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 632 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 11V6.00685C13 5.44995 12.5523 5 12 5C11.4439 5 11 5.45078 11 6.00685V11H6.00685C5.44995 11 5 11.4477 5 12C5 12.5561 5.45078 13 6.00685 13H11V17.9932C11 18.5501 11.4477 19 12 19C12.5561 19 13 18.5492 13 17.9932V13H17.9932C18.5501 13 19 12.5523 19 12C19 11.4439 18.5492 11 17.9932 11H13Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 458 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM20 12C20 16.4183 16.4183 20 12 20C10.1513 20 8.44905 19.3729 7.09437 18.3199L18.3199 7.09437C19.3729 8.44905 20 10.1513 20 12ZM16.9057 5.68016C15.551 4.62709 13.8487 4 12 4C7.58172 4 4 7.58172 4 12C4 13.8487 4.62709 15.551 5.68016 16.9057L16.9057 5.68016Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 538 B |
|
@ -0,0 +1,6 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 8C11 10.2091 9.20921 12 6.99998 12C4.79075 12 2.99998 10.2091 2.99998 8C2.99998 5.79089 4.79075 4 6.99998 4C9.20921 4 11 5.79089 11 8ZM8.99998 8C8.99998 9.10461 8.10448 10 6.99998 10C5.89549 10 4.99998 9.10461 4.99998 8C4.99998 6.89539 5.89549 6 6.99998 6C8.10448 6 8.99998 6.89539 8.99998 8Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M21 11C21 13.2091 19.2092 15 17 15C14.7908 15 13 13.2091 13 11C13 8.79089 14.7908 7 17 7C19.2092 7 21 8.79089 21 11ZM19 11C19 12.1046 18.1045 13 17 13C15.8955 13 15 12.1046 15 11C15 9.89539 15.8955 9 17 9C18.1045 9 19 9.89539 19 11Z" fill="black"/>
|
||||
<path d="M2.55199 16.9336L2.21336 16.6343C1.86693 16.3281 1.87718 15.7845 2.23509 15.4918L2.63573 15.1639C3.74315 14.4288 5.07127 14.0005 6.49998 14H7.49998C8.92943 14 10.2585 14.4285 11.3664 15.1639L11.7671 15.4918C12.125 15.7845 12.1352 16.3281 11.7888 16.6343L11.4502 16.9336C11.2036 17.1515 10.844 17.1832 10.5632 17.0121L9.99998 16.6688C9.26463 16.2435 8.41063 16 7.49998 16H6.50218C5.59154 16 4.73753 16.2435 4.00218 16.6688L3.43895 17.0121C3.15819 17.1832 2.79857 17.1515 2.55199 16.9336Z" fill="black"/>
|
||||
<path d="M12.052 19.9336L11.7134 19.6343C11.3669 19.3281 11.3772 18.7845 11.7351 18.4918L12.1357 18.1639C13.2436 17.4285 14.5727 17 16.0022 17H18.0022C19.4316 17 20.7607 17.4285 21.8686 18.1639L22.2693 18.4918C22.6272 18.7845 22.6374 19.3281 22.291 19.6343L21.9524 19.9336C21.9128 19.9686 21.8701 19.9989 21.8254 20.0242C21.7868 20.046 21.7468 20.0642 21.7058 20.0787C21.602 20.1154 21.4917 20.1288 21.3826 20.1182C21.2727 20.1074 21.164 20.0723 21.0654 20.0121L20.5022 19.6688C19.7668 19.2435 18.9128 19 18.0022 19H16.0022C15.0915 19 14.2375 19.2435 13.5022 19.6688L12.9389 20.0121C12.6582 20.1832 12.2986 20.1515 12.052 19.9336Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 4C6.34315 4 5 5.34315 5 7C5 8.65685 6.34315 10 8 10C9.65685 10 11 8.65685 11 7C11 5.34315 9.65685 4 8 4ZM3 7C3 4.23858 5.23858 2 8 2C10.7614 2 13 4.23858 13 7C13 9.76142 10.7614 12 8 12C5.23858 12 3 9.76142 3 7ZM5 16C3.89543 16 3 16.8954 3 18V20C3 20.5523 2.55228 21 2 21C1.44772 21 1 20.5523 1 20V18C1 15.7909 2.79086 14 5 14H11C13.2091 14 15 15.7909 15 18V20C15 20.5523 14.5523 21 14 21C13.4477 21 13 20.5523 13 20V18C13 16.8954 12.1046 16 11 16H5Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.7071 8.29289C23.0976 8.68342 23.0976 9.31658 22.7071 9.70711L18.7071 13.7071C18.3166 14.0976 17.6834 14.0976 17.2929 13.7071L15.2929 11.7071C14.9024 11.3166 14.9024 10.6834 15.2929 10.2929C15.6834 9.90237 16.3166 9.90237 16.7071 10.2929L18 11.5858L21.2929 8.29289C21.6834 7.90237 22.3166 7.90237 22.7071 8.29289Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1004 B |
|
@ -0,0 +1,5 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.25 12.5C10.0784 12.5 10.75 11.8284 10.75 11C10.75 10.1716 10.0784 9.5 9.25 9.5C8.42163 9.5 7.75 10.1716 7.75 11C7.75 11.8284 8.42163 12.5 9.25 12.5Z" fill="black"/>
|
||||
<path d="M14.75 12.5C15.5784 12.5 16.25 11.8284 16.25 11C16.25 10.1716 15.5784 9.5 14.75 9.5C13.9216 9.5 13.25 10.1716 13.25 11C13.25 11.8284 13.9216 12.5 14.75 12.5Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4C5.68628 4 3 6.68628 3 10V20.5C3 20.8923 3.22949 21.2485 3.58667 21.4106C3.94409 21.5728 4.36328 21.511 4.65845 21.2526L7.52734 18.7423C8.07422 18.2638 8.77637 18 9.50293 18H16C18.7615 18 21 15.7615 21 13V9C21 6.23853 18.7615 4 16 4H9ZM5 10C5 7.79089 6.79077 6 9 6H16C17.6567 6 19 7.34314 19 9V13C19 14.6569 17.6567 16 16 16H9.50293C8.29175 16 7.12183 16.4396 6.21045 17.2371L5 18.2963V10Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 922 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11 6C10.4478 6 10 6.44775 10 7C10 7.55225 10.4478 8 11 8L14.5859 8L6.29297 16.2928C5.90234 16.6835 5.90234 17.3165 6.29297 17.7072C6.68335 18.0977 7.31665 18.0977 7.70703 17.7072L16 9.41419L16 13C16 13.5522 16.4478 14 17 14C17.5522 14 18 13.5522 18 13L18 7C18 6.44775 17.5522 6 17 6L11 6Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 418 B |
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11 6.41418V13C11 13.5522 11.4478 14 12 14C12.5522 14 13 13.5522 13 13V6.41418L14.293 7.70715C14.6833 8.09766 15.3167 8.09766 15.707 7.70715C16.0977 7.31653 16.0977 6.68347 15.707 6.29285L12.707 3.29285C12.5261 3.11194 12.2761 3 12 3C11.7583 3 11.5369 3.08569 11.364 3.22839C11.3394 3.24878 11.3157 3.27026 11.293 3.29285L8.29297 6.29285C7.90234 6.68347 7.90234 7.31653 8.29297 7.70715C8.68335 8.09766 9.31665 8.09766 9.70703 7.70715L11 6.41418Z" fill="black"/>
|
||||
<path d="M5 10C5.55225 10 6 10.4478 6 11V17C6 17.5522 6.44775 18 7 18H17C17.5522 18 18 17.5522 18 17V11C18 10.4478 18.4478 10 19 10C19.5522 10 20 10.4478 20 11V17C20 18.6569 18.6567 20 17 20H7C5.34326 20 4 18.6569 4 17V11C4 10.4478 4.44775 10 5 10Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 839 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.79808 8.99924C3.30984 8.99924 2.01172 9.84928 1.34683 11.101C1.11734 11.5331 1.47549 11.9989 1.9647 11.9989H5.02946C5.44351 11.9989 5.7734 11.6615 5.83386 11.2519C5.90556 10.7662 6.04582 10.3034 6.24425 9.87395C6.3671 9.6081 6.27341 9.27924 5.99496 9.18851C5.61764 9.06555 5.21547 8.99924 4.79808 8.99924ZM4.8345 7.99937C3.72993 7.99937 2.8345 7.10405 2.8345 5.99962C2.8345 4.89519 3.72993 3.99988 4.8345 3.99988C5.93907 3.99988 6.8345 4.89519 6.8345 5.99962C6.8345 7.10405 5.93907 7.99937 4.8345 7.99937ZM11.1143 6.99949C10.0097 6.99949 9.11427 6.10418 9.11427 4.99975C9.11427 3.89532 10.0097 3 11.1143 3C12.2188 3 13.1143 3.89532 13.1143 4.99975C13.1143 6.10418 12.2188 6.99949 11.1143 6.99949ZM8.15292 11.9989C7.60042 11.9989 7.13994 11.5441 7.27438 11.0082C7.70833 9.2784 9.24895 7.99939 11.0762 7.99939C12.9071 7.99939 14.4452 9.27832 14.8782 11.0081C15.0124 11.5441 14.5519 11.9989 13.9994 11.9989H8.15292Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -119,7 +119,7 @@
|
|||
:unviewed-messages-count 0
|
||||
:deleted-at-clock-value last-message-clock-value})
|
||||
:data-store/tx [(chats-store/clear-history-tx chat-id last-message-clock-value)
|
||||
(messages-store/delete-messages-tx chat-id)]}))
|
||||
(messages-store/delete-chat-messages-tx chat-id)]}))
|
||||
|
||||
(fx/defn deactivate-chat
|
||||
[{:keys [db now] :as cofx} chat-id]
|
||||
|
|
|
@ -35,13 +35,6 @@
|
|||
db
|
||||
(group-by (comp time/day-relative :timestamp) messages))})
|
||||
|
||||
(fx/defn group-messages
|
||||
[{:keys [db]}]
|
||||
(reduce-kv (fn [fx chat-id {:keys [messages]}]
|
||||
(group-chat-messages fx chat-id (vals messages)))
|
||||
{:db db}
|
||||
(:chats db)))
|
||||
|
||||
(defn- get-referenced-ids
|
||||
"Takes map of `message-id->messages` and returns set of maps of
|
||||
`{:response-to old-message-id :response-to-v2 message-id}`,
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
[status-im.chat.models :as chat.models]
|
||||
[status-im.contact.db :as contact.db]
|
||||
[status-im.data-store.contacts :as contacts-store]
|
||||
[status-im.data-store.messages :as data-store.messages]
|
||||
[status-im.data-store.chats :as data-store.chats]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.transport.message.contact :as message.contact]
|
||||
[status-im.transport.message.protocol :as protocol]
|
||||
|
@ -12,13 +14,17 @@
|
|||
[status-im.utils.fx :as fx]
|
||||
[status-im.utils.utils :as utils]
|
||||
[status-im.transport.partitioned-topic :as transport.topic]
|
||||
[status-im.utils.config :as config]))
|
||||
[status-im.utils.config :as config]
|
||||
[status-im.chat.models.loading :as chat.models.loading]
|
||||
[status-im.chat.models.message :as chat.models.message]))
|
||||
|
||||
(fx/defn load-contacts
|
||||
[{:keys [db all-contacts]}]
|
||||
(let [contacts-list (map #(vector (:public-key %) %) all-contacts)
|
||||
contacts (into {} contacts-list)]
|
||||
{:db (update db :contacts/contacts #(merge contacts %))}))
|
||||
{:db (-> db
|
||||
(update :contacts/contacts #(merge contacts %))
|
||||
(assoc :contacts/blocked (contact.db/get-blocked-contacts all-contacts)))}))
|
||||
|
||||
(defn can-add-to-contacts? [{:keys [pending? dapp?]}]
|
||||
(and (not dapp?)
|
||||
|
@ -28,11 +34,10 @@
|
|||
|
||||
(defn build-contact [{{:keys [chats] :account/keys [account]
|
||||
:contacts/keys [contacts]} :db} public-key]
|
||||
(cond-> (assoc (or (get contacts public-key)
|
||||
(contact.db/public-key->new-contact public-key))
|
||||
(cond-> (assoc (contact.db/public-key->contact contacts public-key)
|
||||
:address (contact.db/public-key->address public-key))
|
||||
|
||||
(= public-key (:public-key account)) (assoc :name (:name account))))
|
||||
(= public-key (:public-key account))
|
||||
(assoc :name (:name account))))
|
||||
|
||||
(defn- own-info [db]
|
||||
(let [{:keys [name photo-path address]} (:account/account db)
|
||||
|
@ -101,6 +106,108 @@
|
|||
{:db (assoc-in db [:contacts/contacts public-key :tags] tags)
|
||||
:data-store/tx [(contacts-store/remove-contact-tag-tx public-key tag)]}))
|
||||
|
||||
(fx/defn block-contact-confirmation
|
||||
[cofx public-key]
|
||||
{:utils/show-confirmation
|
||||
{:title (i18n/label :t/block-contact)
|
||||
:content (i18n/label :t/block-contact-details)
|
||||
:confirm-button-text (i18n/label :t/to-block)
|
||||
:on-accept #(re-frame/dispatch [:contact.ui/block-contact-confirmed public-key])}})
|
||||
|
||||
(defn get-removed-unseen-count
|
||||
[current-public-key user-statuses removed-messages-ids]
|
||||
(- (count removed-messages-ids)
|
||||
(count (filter (fn [[_ statuses]]
|
||||
(= :seen
|
||||
(:status (get statuses
|
||||
current-public-key))))
|
||||
user-statuses))))
|
||||
|
||||
(fx/defn clean-up-chat
|
||||
[{:keys [db get-stored-user-statuses] :as cofx} chat-id removed-chat-messages]
|
||||
(let [current-public-key (accounts.db/current-public-key cofx)
|
||||
removed-messages-ids (map :message-id removed-chat-messages)
|
||||
user-statuses (get-stored-user-statuses chat-id
|
||||
removed-messages-ids)
|
||||
removed-unseen-count (get-removed-unseen-count current-public-key
|
||||
user-statuses
|
||||
removed-messages-ids)
|
||||
db (-> db
|
||||
;; remove messages
|
||||
(update-in [:chats chat-id :messages]
|
||||
#(apply dissoc % removed-messages-ids))
|
||||
;; remove message statuses
|
||||
(update-in [:chats chat-id :messages-statuses]
|
||||
#(apply dissoc % removed-messages-ids))
|
||||
;; remove message groups
|
||||
(update-in [:chats chat-id]
|
||||
dissoc :message-groups))]
|
||||
(fx/merge cofx
|
||||
{:db db}
|
||||
;; update unviewed messages count
|
||||
(chat.models/upsert-chat
|
||||
{:chat-id chat-id
|
||||
:unviewed-messages-count
|
||||
(- (get-in db [:chats chat-id :unviewed-messages-count])
|
||||
removed-unseen-count)})
|
||||
;; recompute message group
|
||||
(chat.models.loading/group-chat-messages
|
||||
chat-id
|
||||
(vals (get-in db [:chats chat-id :messages]))))))
|
||||
|
||||
(fx/defn clean-up-chats
|
||||
[cofx removed-messages-by-chat]
|
||||
(apply fx/merge cofx
|
||||
(map (fn [[chat-id messages]]
|
||||
(clean-up-chat chat-id messages))
|
||||
removed-messages-by-chat)))
|
||||
|
||||
(fx/defn remove-current-chat-id
|
||||
[{:keys [db] :as cofx}]
|
||||
(fx/merge cofx
|
||||
{:db (dissoc db :current-chat-id)}
|
||||
(navigation/navigate-to-clean :home {})))
|
||||
|
||||
(fx/defn block-contact
|
||||
[{:keys [db get-user-messages] :as cofx} public-key]
|
||||
(let [contact (assoc (contact.db/public-key->contact
|
||||
(:contacts/contacts db)
|
||||
public-key)
|
||||
:blocked? true)
|
||||
user-messages (get-user-messages public-key)
|
||||
user-messages-ids (map :message-id user-messages)
|
||||
;; we make sure to remove the 1-1 chat which we delete entirely
|
||||
removed-messages-by-chat (-> (group-by :chat-id user-messages)
|
||||
(dissoc public-key))
|
||||
from-one-to-one-chat? (not (get-in db [:chats (:current-chat-id db) :group-chat]))]
|
||||
(fx/merge cofx
|
||||
{:db (-> db
|
||||
;; add the contact to blocked contacts
|
||||
(update :contacts/blocked conj public-key)
|
||||
;; update the contact in contacts list
|
||||
(assoc-in [:contacts/contacts public-key] contact)
|
||||
;; remove the 1-1 chat if it exists
|
||||
(update-in [:chats] dissoc public-key))
|
||||
:data-store/tx [(contacts-store/block-user-tx contact
|
||||
user-messages-ids)]}
|
||||
;;remove the messages from chat
|
||||
(clean-up-chats removed-messages-by-chat)
|
||||
(chat.models.message/update-last-messages
|
||||
(keys removed-messages-by-chat))
|
||||
;; reset navigation to avoid going back to non existing one to one chat
|
||||
(if from-one-to-one-chat?
|
||||
remove-current-chat-id
|
||||
(navigation/navigate-back)))))
|
||||
|
||||
(fx/defn unblock-contact
|
||||
[{:keys [db]} public-key]
|
||||
(let [contact (assoc (get-in db [:contacts/contacts public-key])
|
||||
:blocked? false)]
|
||||
{:db (-> db
|
||||
(update :contacts/blocked disj public-key)
|
||||
(assoc-in [:contacts/contacts public-key] contact))
|
||||
:data-store/tx [(contacts-store/save-contact-tx contact)]}))
|
||||
|
||||
(defn handle-contact-update
|
||||
[public-key
|
||||
timestamp
|
||||
|
|
|
@ -68,6 +68,12 @@
|
|||
:photo-path (identicon/identicon public-key)
|
||||
:public-key public-key})
|
||||
|
||||
(defn public-key->contact
|
||||
[contacts public-key]
|
||||
(when public-key
|
||||
(get contacts public-key
|
||||
(public-key->new-contact public-key))))
|
||||
|
||||
(defn public-key->address [public-key]
|
||||
(let [length (count public-key)
|
||||
normalized-key (case length
|
||||
|
@ -94,6 +100,13 @@
|
|||
(clojure.string/lower-case name2))))
|
||||
(vals contacts)))
|
||||
|
||||
(defn active
|
||||
[contacts]
|
||||
(->> contacts
|
||||
(remove (fn [[_ {:keys [pending? hide-contact? blocked?]}]]
|
||||
(or pending? hide-contact? blocked?)))
|
||||
sort-contacts))
|
||||
|
||||
(defn filter-dapps
|
||||
[v dev-mode?]
|
||||
(remove #(when-not dev-mode? (true? (:developer? %))) v))
|
||||
|
@ -121,3 +134,11 @@
|
|||
(map #(if (admins (:public-key %))
|
||||
(assoc % :admin? true)
|
||||
%)))))
|
||||
|
||||
(defn get-blocked-contacts
|
||||
[contacts]
|
||||
(into #{} (map :public-key (filter :blocked? contacts))))
|
||||
|
||||
(defn blocked?
|
||||
[db contact]
|
||||
(get-in db [:contacts/contacts contact :blocked?]))
|
||||
|
|
|
@ -23,12 +23,30 @@
|
|||
(re-frame/reg-sub
|
||||
:contacts/active
|
||||
:<- [:contacts/contacts]
|
||||
(fn [contacts]
|
||||
(contact.db/active contacts)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:contacts/active-count
|
||||
:<- [:contacts/active]
|
||||
(fn [active-contacts]
|
||||
(count active-contacts)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:contacts/blocked
|
||||
:<- [:contacts/contacts]
|
||||
(fn [contacts]
|
||||
(->> contacts
|
||||
(remove (fn [[_ {:keys [pending? hide-contact?]}]]
|
||||
(or pending? hide-contact?)))
|
||||
(filter (fn [[_ {:keys [blocked?]}]]
|
||||
blocked?))
|
||||
(contact.db/sort-contacts))))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:contacts/blocked-count
|
||||
:<- [:contacts/blocked]
|
||||
(fn [blocked-contacts]
|
||||
(count blocked-contacts)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:contacts/current-contact-identity
|
||||
(fn [db]
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
(ns status-im.data-store.contacts
|
||||
(:require [goog.object :as object]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.data-store.realm.core :as core]))
|
||||
[status-im.data-store.realm.core :as core]
|
||||
[clojure.set :as clojure.set]))
|
||||
|
||||
(defn- normalize-contact [contact]
|
||||
(-> contact
|
||||
|
@ -21,7 +22,7 @@
|
|||
(fn [realm]
|
||||
(core/create realm
|
||||
:contact
|
||||
(dissoc contact :command :response :subscriptions)
|
||||
contact
|
||||
true)))
|
||||
|
||||
(defn save-contacts-tx
|
||||
|
@ -34,6 +35,53 @@
|
|||
(defn- get-contact-by-id [public-key realm]
|
||||
(core/single (core/get-by-field realm :contact :public-key public-key)))
|
||||
|
||||
(defn- get-messages-by-messages-ids
|
||||
[message-ids]
|
||||
(when (not-empty message-ids)
|
||||
(-> @core/account-realm
|
||||
(.objects "message")
|
||||
(.filtered (str "(" (core/in-query "message-id" message-ids) ")")))))
|
||||
|
||||
(defn- get-statuses-by-messages-ids
|
||||
[message-ids]
|
||||
(when-not (empty message-ids)
|
||||
(-> @core/account-realm
|
||||
(.objects "user-status")
|
||||
(.filtered (str "(" (core/in-query "message-id" message-ids) ")")))))
|
||||
|
||||
(defn- get-user-statuses
|
||||
[public-key]
|
||||
(core/get-by-field @core/account-realm
|
||||
:user-status
|
||||
:public-key
|
||||
public-key))
|
||||
|
||||
(defn- get-chat
|
||||
[public-key]
|
||||
(core/single
|
||||
(core/get-by-field @core/account-realm
|
||||
:chat
|
||||
:chat-id
|
||||
public-key)))
|
||||
|
||||
(defn block-user-tx
|
||||
"Returns tx function for deleting user messages"
|
||||
[{:keys [public-key] :as contact} messages-ids]
|
||||
(fn [realm]
|
||||
(core/create realm :contact contact true)
|
||||
(when-let [user-messages
|
||||
(get-messages-by-messages-ids messages-ids)]
|
||||
(core/delete realm user-messages))
|
||||
(when-let [user-messages-statuses
|
||||
(get-statuses-by-messages-ids messages-ids)]
|
||||
(core/delete realm user-messages-statuses))
|
||||
(when-let [user-statuses
|
||||
(get-user-statuses public-key)]
|
||||
(core/delete realm user-statuses))
|
||||
(when-let [chat
|
||||
(get-chat public-key)]
|
||||
(core/delete realm chat))))
|
||||
|
||||
(defn delete-contact-tx
|
||||
"Returns tx function for deleting contact"
|
||||
[public-key]
|
||||
|
|
|
@ -85,6 +85,21 @@
|
|||
(fn [cofx _]
|
||||
(assoc cofx :get-referenced-messages get-references-by-ids)))
|
||||
|
||||
(defn get-user-messages
|
||||
[public-key]
|
||||
(.reduce (core/get-by-field @core/account-realm
|
||||
:message :from public-key)
|
||||
(fn [acc message-object _ _]
|
||||
(conj acc
|
||||
{:message-id (aget message-object "message-id")
|
||||
:chat-id (aget message-object "chat-id")}))
|
||||
[]))
|
||||
|
||||
(re-frame/reg-cofx
|
||||
:data-store/get-user-messages
|
||||
(fn [cofx _]
|
||||
(assoc cofx :get-user-messages get-user-messages)))
|
||||
|
||||
(defn prepare-content [content]
|
||||
(if (string? content)
|
||||
content
|
||||
|
@ -112,7 +127,7 @@
|
|||
(core/delete realm message)
|
||||
(core/delete realm (core/get-by-field realm :user-status :message-id message-id)))))
|
||||
|
||||
(defn delete-messages-tx
|
||||
(defn delete-chat-messages-tx
|
||||
"Returns tx function for deleting messages with user statuses for given chat-id"
|
||||
[chat-id]
|
||||
(fn [realm]
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
[status-im.signals.core :as signals]
|
||||
[status-im.transport.message.core :as transport.message]
|
||||
[status-im.ui.screens.currency-settings.models :as currency-settings.models]
|
||||
[status-im.chat.models.message :as models.message]
|
||||
[status-im.node.core :as node]
|
||||
[status-im.web3.core :as web3]
|
||||
[status-im.ui.screens.navigation :as navigation]
|
||||
|
@ -1468,6 +1469,23 @@
|
|||
(contact/add-contacts-filter cofx public-key :add-contact)
|
||||
(contact/add-contact cofx public-key))))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:contact.ui/block-contact-pressed
|
||||
(fn [cofx [_ public-key]]
|
||||
(contact/block-contact-confirmation cofx public-key)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:contact.ui/block-contact-confirmed
|
||||
[(re-frame/inject-cofx :data-store/get-user-messages)
|
||||
(re-frame/inject-cofx :data-store/get-user-statuses)]
|
||||
(fn [cofx [_ public-key]]
|
||||
(contact/block-contact cofx public-key)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:contact.ui/unblock-contact-pressed
|
||||
(fn [cofx [_ public-key]]
|
||||
(contact/unblock-contact cofx public-key)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:contact.ui/close-contact-pressed
|
||||
(fn [cofx [_ public-key]]
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
[taoensso.timbre :as log]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.accounts.db :as accounts.db]
|
||||
[status-im.contact.db :as contact.db]
|
||||
[status-im.chat.models :as chat-model]
|
||||
[status-im.utils.platform :as platform]
|
||||
[status-im.utils.fx :as fx]
|
||||
|
@ -82,7 +83,7 @@
|
|||
(:public-key
|
||||
(first
|
||||
(filter #(= (anonymize-pubkey (:public-key %)) hash)
|
||||
(vals accounts)))))
|
||||
accounts))))
|
||||
|
||||
(defn lookup-contact-pubkey-from-hash
|
||||
[{:keys [db] :as cofx} contact-pubkey-or-hash]
|
||||
|
@ -93,13 +94,14 @@
|
|||
(= (count contact-pubkey-or-hash) pn-pubkey-hash-length))
|
||||
(if-let
|
||||
[account-pubkey (hash->pubkey contact-pubkey-or-hash
|
||||
(:accounts/accounts db))]
|
||||
(vals (:accounts/accounts db)))]
|
||||
account-pubkey
|
||||
(if (accounts.db/logged-in? cofx)
|
||||
;; TODO: for simplicity we're doing a linear lookup of the contacts,
|
||||
;; but we might want to build a map of hashed pubkeys to pubkeys
|
||||
;; for this purpose
|
||||
(hash->pubkey contact-pubkey-or-hash (:contacts/contacts db))
|
||||
(hash->pubkey contact-pubkey-or-hash
|
||||
(contact.db/active (:contacts/contacts db)))
|
||||
(do
|
||||
(log/warn "failed to lookup contact from hash, not logged in")
|
||||
contact-pubkey-or-hash)))
|
||||
|
@ -202,7 +204,7 @@
|
|||
(and (valid-notification-payload? rehydrated-payload)
|
||||
(accounts.db/logged-in? cofx)
|
||||
(some #(= (:public-key %) from)
|
||||
(vals (:contacts/contacts db)))
|
||||
(contact.db/active (:contacts/contacts db)))
|
||||
(some #(= (:chat-id %) from)
|
||||
(vals (:chats db)))))
|
||||
|
||||
|
@ -318,10 +320,10 @@
|
|||
(create-notification-channel))
|
||||
(handle-initial-push-notification)))
|
||||
|
||||
(fx/defn process-stored-event [cofx address stored-pns]
|
||||
(fx/defn process-stored-event [{:keys [db] :as cofx} address stored-pns]
|
||||
(when-not platform/desktop?
|
||||
(if (accounts.db/logged-in? cofx)
|
||||
(let [current-account (get-in cofx [:db :account/account])
|
||||
(let [current-account (:account/account db)
|
||||
current-address (:address current-account)
|
||||
current-account-pubkey (:public-key current-account)
|
||||
stored-pn-val-json (or (get stored-pns current-account-pubkey)
|
||||
|
@ -333,6 +335,7 @@
|
|||
from (lookup-contact-pubkey-from-hash cofx (:from stored-pn-payload))
|
||||
to (lookup-contact-pubkey-from-hash cofx (:to stored-pn-payload))]
|
||||
(when (and from
|
||||
(not (contact.db/blocked? db from))
|
||||
(= address current-address))
|
||||
(log/debug "process-stored-event" "address" address "from" from "to" to)
|
||||
(handle-push-notification-open cofx
|
||||
|
|
|
@ -12,11 +12,14 @@
|
|||
|
||||
(fx/defn receive-message
|
||||
[cofx now-in-s filter-chat-id js-message]
|
||||
(let [{:keys [payload sig timestamp ttl]} (js->clj js-message :keywordize-keys true)
|
||||
(let [blocked-contacts (get-in cofx [:db :contacts/blocked] #{})
|
||||
{:keys [payload sig timestamp ttl]} (js->clj js-message :keywordize-keys true)
|
||||
status-message (-> payload
|
||||
transport.utils/to-utf8
|
||||
transit/deserialize)]
|
||||
(when (and sig status-message)
|
||||
(when (and sig
|
||||
status-message
|
||||
(not (blocked-contacts sig)))
|
||||
(try
|
||||
(when-let [valid-message (protocol/validate status-message)]
|
||||
(fx/merge (assoc cofx :js-obj js-message)
|
||||
|
|
|
@ -30,8 +30,16 @@
|
|||
|
||||
(def icons
|
||||
(if platform/desktop?
|
||||
{:icons/discover (js/require "./resources/icons/bottom/discover_gray.svg")
|
||||
:icons/contacts (js/require "./resources/icons/bottom/contacts_gray.svg")
|
||||
{:main-icons/add (js/require "./resources/icons/main/add.svg")
|
||||
:main-icons/cancel (js/require "./resources/icons/main/cancel.svg")
|
||||
:main-icons/group-chat (js/require "./resources/icons/main/group_chat.svg")
|
||||
:main-icons/in-contacts (js/require "./resources/icons/main/in_contacts.svg")
|
||||
:main-icons/message (js/require "./resources/icons/main/message.svg")
|
||||
:main-icons/send (js/require "./resources/icons/main/send.svg")
|
||||
:main-icons/share (js/require "./resources/icons/main/share.svg")
|
||||
:tiny-icons/tiny-group (js/require "./resources/icons/tiny/tiny_group.svg")
|
||||
:icons/discover (js/require "./resources/icons/bottom/discover_gray.svg")
|
||||
|
||||
:icons/home (js/require "./resources/icons/bottom/home_gray.svg")
|
||||
:icons/home-active (js/require "./resources/icons/bottom/home_blue.svg")
|
||||
:icons/profile (js/require "./resources/icons/bottom/profile_gray.svg")
|
||||
|
@ -41,7 +49,6 @@
|
|||
:icons/speaker (js/require "./resources/icons/speaker.svg")
|
||||
:icons/speaker-off (js/require "./resources/icons/speaker_off.svg")
|
||||
:icons/transaction-history (js/require "./resources/icons/transaction_history.svg")
|
||||
:icons/add (js/require "./resources/icons/add.svg")
|
||||
:icons/add-contact (js/require "./resources/icons/add_contact.svg")
|
||||
:icons/add-wallet (js/require "./resources/icons/add_wallet.svg")
|
||||
:icons/address (js/require "./resources/icons/address.svg")
|
||||
|
@ -60,12 +67,9 @@
|
|||
:icons/exclamation-mark (js/require "./resources/icons/exclamation_mark.svg")
|
||||
:icons/filter (js/require "./resources/icons/filter.svg")
|
||||
:icons/fullscreen (js/require "./resources/icons/fullscreen.svg")
|
||||
:icons/group-big (js/require "./resources/icons/group_big.svg")
|
||||
:icons/group-chat (js/require "./resources/icons/group_chat.svg")
|
||||
:icons/chats (js/require "./resources/icons/chats.svg")
|
||||
:icons/hamburger (js/require "./resources/icons/hamburger.svg")
|
||||
:icons/hidden (js/require "./resources/icons/hidden.svg")
|
||||
:icons/in-contacts (js/require "./resources/icons/in_contacts.svg")
|
||||
:icons/lock (js/require "./resources/icons/lock.svg")
|
||||
:icons/mic (js/require "./resources/icons/mic.svg")
|
||||
:icons/mobile (js/require "./resources/icons/mobile.svg")
|
||||
|
@ -81,7 +85,6 @@
|
|||
:icons/up (js/require "./resources/icons/up.svg")
|
||||
:icons/down (js/require "./resources/icons/down.svg")
|
||||
:icons/grab (js/require "./resources/icons/grab.svg")
|
||||
:icons/share (js/require "./resources/icons/share.svg")
|
||||
:icons/tooltip-triangle (js/require "./resources/icons/tooltip-triangle.svg")
|
||||
:icons/open (js/require "./resources/icons/open.svg")
|
||||
:icons/network (js/require "./resources/icons/network.svg")
|
||||
|
@ -106,7 +109,15 @@
|
|||
:icons/indicator-middle (js/require "./resources/icons/indicator-middle.svg")
|
||||
:icons/indicator-small (js/require "./resources/icons/indicator-small.svg")
|
||||
:icons/stickers (js/require "./resources/icons/stickers.svg")}
|
||||
{:icons/discover (components.svg/slurp-svg "./resources/icons/bottom/discover_gray.svg")
|
||||
{:main-icons/add (components.svg/slurp-svg "./resources/icons/main/add.svg")
|
||||
:main-icons/cancel (components.svg/slurp-svg "./resources/icons/main/cancel.svg")
|
||||
:main-icons/group-chat (components.svg/slurp-svg "./resources/icons/main/group_chat.svg")
|
||||
:main-icons/in-contacts (components.svg/slurp-svg "./resources/icons/main/in_contacts.svg")
|
||||
:main-icons/message (components.svg/slurp-svg "./resources/icons/main/message.svg")
|
||||
:main-icons/send (components.svg/slurp-svg "./resources/icons/main/send.svg")
|
||||
:main-icons/share (components.svg/slurp-svg "./resources/icons/main/share.svg")
|
||||
:tiny-icons/tiny-group (components.svg/slurp-svg "./resources/icons/tiny/tiny_group.svg")
|
||||
:icons/discover (components.svg/slurp-svg "./resources/icons/bottom/discover_gray.svg")
|
||||
:icons/contacts (components.svg/slurp-svg "./resources/icons/bottom/contacts_gray.svg")
|
||||
:icons/home (components.svg/slurp-svg "./resources/icons/bottom/home_gray.svg")
|
||||
:icons/home-active (components.svg/slurp-svg "./resources/icons/bottom/home_blue.svg")
|
||||
|
@ -117,7 +128,6 @@
|
|||
:icons/speaker (components.svg/slurp-svg "./resources/icons/speaker.svg")
|
||||
:icons/speaker-off (components.svg/slurp-svg "./resources/icons/speaker_off.svg")
|
||||
:icons/transaction-history (components.svg/slurp-svg "./resources/icons/transaction_history.svg")
|
||||
:icons/add (components.svg/slurp-svg "./resources/icons/add.svg")
|
||||
:icons/add-contact (components.svg/slurp-svg "./resources/icons/add_contact.svg")
|
||||
:icons/add-wallet (components.svg/slurp-svg "./resources/icons/add_wallet.svg")
|
||||
:icons/address (components.svg/slurp-svg "./resources/icons/address.svg")
|
||||
|
@ -139,12 +149,9 @@
|
|||
:icons/exclamation-mark (components.svg/slurp-svg "./resources/icons/exclamation_mark.svg")
|
||||
:icons/filter (components.svg/slurp-svg "./resources/icons/filter.svg")
|
||||
:icons/fullscreen (components.svg/slurp-svg "./resources/icons/fullscreen.svg")
|
||||
:icons/group-big (components.svg/slurp-svg "./resources/icons/group_big.svg")
|
||||
:icons/group-chat (components.svg/slurp-svg "./resources/icons/group_chat.svg")
|
||||
:icons/chats (components.svg/slurp-svg "./resources/icons/chats.svg")
|
||||
:icons/hamburger (components.svg/slurp-svg "./resources/icons/hamburger.svg")
|
||||
:icons/hidden (components.svg/slurp-svg "./resources/icons/hidden.svg")
|
||||
:icons/in-contacts (components.svg/slurp-svg "./resources/icons/in_contacts.svg")
|
||||
:icons/lock (components.svg/slurp-svg "./resources/icons/lock.svg")
|
||||
:icons/lock-opened (components.svg/slurp-svg "./resources/icons/lock_opened.svg")
|
||||
:icons/mic (components.svg/slurp-svg "./resources/icons/mic.svg")
|
||||
|
@ -161,7 +168,6 @@
|
|||
:icons/up (components.svg/slurp-svg "./resources/icons/up.svg")
|
||||
:icons/down (components.svg/slurp-svg "./resources/icons/down.svg")
|
||||
:icons/grab (components.svg/slurp-svg "./resources/icons/grab.svg")
|
||||
:icons/share (components.svg/slurp-svg "./resources/icons/share.svg")
|
||||
:icons/tooltip-triangle (components.svg/slurp-svg "./resources/icons/tooltip-triangle.svg")
|
||||
:icons/open (components.svg/slurp-svg "./resources/icons/open.svg")
|
||||
:icons/network (components.svg/slurp-svg "./resources/icons/network.svg")
|
||||
|
|
|
@ -37,8 +37,16 @@
|
|||
(def image-size 40)
|
||||
|
||||
(def item-image
|
||||
{:width image-size
|
||||
:height image-size})
|
||||
{:width image-size
|
||||
:height image-size})
|
||||
|
||||
(def big-item-image
|
||||
{:width image-size
|
||||
:height image-size
|
||||
:margin-right 16
|
||||
:border-radius 40
|
||||
:border-color (colors/alpha colors/gray 0.1)
|
||||
:border-width 1})
|
||||
|
||||
(def icon-size 24)
|
||||
(def icon-wrapper-size (+ icon-size (* 2 8)))
|
||||
|
@ -65,6 +73,41 @@
|
|||
(def right-item-wrapper
|
||||
{:justify-content :center})
|
||||
|
||||
(def settings-item-separator
|
||||
{:margin-left 16})
|
||||
|
||||
(def settings-item
|
||||
{:padding-left 16
|
||||
:padding-right 8
|
||||
:flex 1
|
||||
:flex-direction :row
|
||||
:align-items :center
|
||||
:background-color colors/white
|
||||
:height 52})
|
||||
|
||||
(defn settings-item-icon [icon-color]
|
||||
{:background-color (colors/alpha icon-color 0.1)
|
||||
:width 40
|
||||
:height 40
|
||||
:border-radius 40
|
||||
:margin-right 16
|
||||
:justify-content :center
|
||||
:align-items :center})
|
||||
|
||||
(defn settings-item-text
|
||||
[color]
|
||||
{:flex 1
|
||||
:flex-wrap :nowrap
|
||||
:font-size 17
|
||||
:color color})
|
||||
|
||||
(def settings-item-value
|
||||
{:flex-wrap :nowrap
|
||||
:text-align :right
|
||||
:padding-right 10
|
||||
:font-size 15
|
||||
:color colors/gray})
|
||||
|
||||
(def base-separator
|
||||
{:height 1
|
||||
:background-color colors/gray-light})
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
"
|
||||
(:require-macros [status-im.utils.views :as views])
|
||||
(:require [reagent.core :as reagent]
|
||||
[clojure.string :as string]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.ui.components.animation :as animation]
|
||||
[status-im.ui.components.checkbox.view :as checkbox]
|
||||
[status-im.ui.components.colors :as colors]
|
||||
|
@ -101,6 +103,38 @@
|
|||
:style {:width 12}
|
||||
:icon-opts {:color colors/white}}])
|
||||
|
||||
(defn big-list-item
|
||||
[{:keys [text text-color value action-fn active? destructive? hide-chevron?
|
||||
accessory-value text-color
|
||||
accessibility-label icon icon-color image-source icon-content]
|
||||
:or {icon-color colors/blue
|
||||
text-color colors/black
|
||||
value ""
|
||||
active? true}}]
|
||||
{:pre [(or icon image-source)
|
||||
(and action-fn text)
|
||||
(or (nil? accessibility-label) (keyword? accessibility-label))]}
|
||||
[react/touchable-highlight
|
||||
(cond-> {:on-press action-fn
|
||||
:accessibility-label accessibility-label
|
||||
:disabled (not active?)})
|
||||
[react/view styles/settings-item
|
||||
(if icon
|
||||
[react/view (styles/settings-item-icon icon-color)
|
||||
[vector-icons/icon icon {:color icon-color}]]
|
||||
[react/image {:source {:uri image-source}
|
||||
:style styles/big-item-image}])
|
||||
[react/text {:style (styles/settings-item-text text-color)
|
||||
:number-of-lines 1}
|
||||
text]
|
||||
(when accessory-value
|
||||
[react/text {:style styles/settings-item-value
|
||||
:number-of-lines 1
|
||||
:uppercase? true}
|
||||
(str accessory-value)])
|
||||
(when-not hide-chevron?
|
||||
[vector-icons/icon :icons/forward {:color (colors/alpha colors/gray 0.4)}])]])
|
||||
|
||||
(defn- wrap-render-fn [f]
|
||||
(fn [data]
|
||||
(reagent/as-element (f (.-item data) (.-index data) (.-separators data)))))
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
[status-im.ui.components.toolbar.styles :as styles]))
|
||||
|
||||
(defn add [illuminated? handler]
|
||||
{:icon :icons/add
|
||||
{:icon :main-icons/add
|
||||
:icon-opts (if illuminated? styles/icon-add-illuminated styles/icon-add)
|
||||
:handler handler})
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
[action-button/action-button
|
||||
{:label (i18n/label :t/start-group-chat)
|
||||
:accessibility-label :start-group-chat-button
|
||||
:icon :icons/contacts
|
||||
:icon :main-icons/group-chat
|
||||
:icon-opts {:color colors/blue}
|
||||
:on-press #(re-frame/dispatch [:contact.ui/start-group-chat-pressed])}]
|
||||
[action-button/action-separator]
|
||||
|
@ -46,7 +46,7 @@
|
|||
[action-button/action-button
|
||||
{:label (i18n/label :t/invite-friends)
|
||||
:accessibility-label :invite-friends-button
|
||||
:icon :icons/share
|
||||
:icon :main-icons/share
|
||||
:icon-opts {:color colors/blue}
|
||||
:on-press #(list-selection/open-share {:message (i18n/label :t/get-status-at)})}]
|
||||
[action-button/action-separator]
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
(re-frame/dispatch [:stickers/load-packs])
|
||||
(re-frame/dispatch [:navigate-to :stickers]))
|
||||
:selected? false :background-color colors/blue}
|
||||
[vector-icons/icon :icons/add {:width 20 :height 20 :color colors/white}]]
|
||||
[vector-icons/icon :main-icons/add {:width 20 :height 20 :color colors/white}]]
|
||||
[react/view {:width 4}]
|
||||
[pack-icon {:id :recent :selected? (or (= :recent selected-pack) (and (nil? selected-pack) (seq installed-packs)))}
|
||||
[vector-icons/icon :icons/clock]]
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
{:on-press #(re-frame/dispatch [:contact.ui/add-to-contact-pressed contact-identity])
|
||||
:accessibility-label :add-to-contacts-button}
|
||||
[react/view style/add-contact-center
|
||||
[vector-icons/icon :icons/add {:color colors/blue}]
|
||||
[vector-icons/icon :main-icons/add {:color colors/blue}]
|
||||
[react/i18n-text {:style style/add-contact-text :key :add-to-contacts}]]]
|
||||
[react/touchable-highlight
|
||||
{:on-press #(re-frame/dispatch [:contact.ui/close-contact-pressed contact-identity])
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
(ns status-im.ui.screens.contacts-list.views
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.ui.components.colors :as colors]
|
||||
[status-im.ui.components.list.views :as list.views]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.ui.components.contact.contact :as contact-view]
|
||||
[status-im.ui.components.status-bar.view :as status-bar]
|
||||
[status-im.ui.components.toolbar.view :as toolbar.view])
|
||||
(:require-macros [status-im.utils.views :refer [defview letsubs]]))
|
||||
|
||||
(defn contacts-list-item [{:keys [public-key name photo-path] :as contact}]
|
||||
[list.views/big-list-item
|
||||
{:text name
|
||||
:image-source photo-path
|
||||
:action-fn #(re-frame/dispatch [:chat.ui/show-profile public-key])}])
|
||||
|
||||
(defview contacts-list []
|
||||
(letsubs [blocked-contacts-count [:contacts/blocked-count]
|
||||
contacts [:contacts/active]]
|
||||
[react/view {:flex 1
|
||||
:background-color colors/white}
|
||||
[status-bar/status-bar]
|
||||
[toolbar.view/simple-toolbar (i18n/label :t/contacts)]
|
||||
[react/scroll-view {:style {:background-color colors/white
|
||||
:padding-top 16}}
|
||||
[list.views/big-list-item
|
||||
{:text (i18n/label :t/blocked-users)
|
||||
:icon :main-icons/cancel
|
||||
:icon-color colors/red
|
||||
:accessibility-label :blocked-users-list-button
|
||||
:accessory-value blocked-contacts-count
|
||||
:action-fn #(re-frame/dispatch [:navigate-to :blocked-users-list])}]
|
||||
[react/view {:height 16}]
|
||||
[list.views/flat-list
|
||||
{:data contacts
|
||||
:key-fn :address
|
||||
:render-fn contacts-list-item}]]]))
|
||||
|
||||
(defview blocked-users-list []
|
||||
(letsubs [blocked-contacts [:contacts/blocked]]
|
||||
[react/view {:flex 1
|
||||
:background-color colors/white}
|
||||
[status-bar/status-bar]
|
||||
[toolbar.view/simple-toolbar (i18n/label :t/blocked-users)]
|
||||
[react/scroll-view {:style {:background-color colors/white
|
||||
:padding-vertical 8}}
|
||||
[list.views/flat-list
|
||||
{:data blocked-contacts
|
||||
:key-fn :address
|
||||
:render-fn contacts-list-item
|
||||
:default-separator? true
|
||||
:enableEmptySections true
|
||||
:keyboardShouldPersistTaps :always}]]]))
|
|
@ -360,12 +360,12 @@
|
|||
[react/view {:style styles/chat-profile-row}
|
||||
[react/view {:style styles/chat-profile-icon-container
|
||||
:accessibility-label :add-contact-link}
|
||||
[vector-icons/icon :icons/add {:style (styles/chat-profile-icon colors/blue)}]]
|
||||
[vector-icons/icon :main-icons/add {:style (styles/chat-profile-icon colors/blue)}]]
|
||||
[react/text {:style (styles/contact-card-text colors/blue)} (i18n/label :t/add-to-contacts)]]]
|
||||
[react/view {:style styles/chat-profile-row}
|
||||
[react/view {:style styles/chat-profile-icon-container
|
||||
:accessibility-label :add-contact-link}
|
||||
[vector-icons/icon :icons/add {:style (styles/chat-profile-icon colors/gray)}]]
|
||||
[vector-icons/icon :main-icons/add {:style (styles/chat-profile-icon colors/gray)}]]
|
||||
[react/text {:style (styles/contact-card-text colors/gray)} (i18n/label :t/in-contacts)]])
|
||||
[react/touchable-highlight
|
||||
{:on-press #(re-frame/dispatch
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
[react/view {:style styles/chat-name-last-msg-box}
|
||||
[react/view {:style styles/chat-name-box}
|
||||
(when (and group-chat (not public?))
|
||||
[icons/icon :icons/group-chat])
|
||||
[icons/icon :tiny-icons/tiny-group])
|
||||
(when public?
|
||||
[icons/icon :icons/public-chat])
|
||||
[react/text {:ellipsize-mode :tail
|
||||
|
@ -126,7 +126,7 @@
|
|||
[action-button/action-button
|
||||
{:label (i18n/label :t/start-group-chat)
|
||||
:accessibility-label :start-group-chat-button
|
||||
:icon :icons/contacts
|
||||
:icon :main-icons/group-chat
|
||||
:icon-opts {:color colors/blue}
|
||||
:on-press #(do
|
||||
(re-frame/dispatch [:set-in [:desktop :popup] nil])
|
||||
|
@ -157,7 +157,7 @@
|
|||
[react/view {:style styles/add-new}
|
||||
(if logging-in?
|
||||
[components/activity-indicator {:animating true :color :white}]
|
||||
[icons/icon :icons/add {:style {:tint-color :white}}])]]]]
|
||||
[icons/icon :main-icons/add {:style {:tint-color :white}}])]]]]
|
||||
[react/scroll-view {:enableArrayScrollingOptimization true}
|
||||
[react/view
|
||||
(for [[index chat] (map-indexed vector filtered-home-items)]
|
||||
|
|
|
@ -164,7 +164,7 @@
|
|||
:on-press #(.openURL react/linking "https://hardwallet.status.im")}]
|
||||
(when pairing
|
||||
[react/view
|
||||
[action-row {:icon :icons/add
|
||||
[action-row {:icon :main-icons/add
|
||||
:label :t/change-pin
|
||||
:on-press #(re-frame/dispatch [:keycard-settings.ui/change-pin-pressed])}]
|
||||
[action-row {:icon :icons/close
|
||||
|
|
|
@ -51,11 +51,10 @@
|
|||
[react/touchable-highlight {:accessibility-label :new-chat-button
|
||||
:on-press (when logged-in? #(re-frame/dispatch [:navigate-to :new]))}
|
||||
[react/view styles/action-button
|
||||
|
||||
(if-not logged-in?
|
||||
[components/activity-indicator {:color :white
|
||||
:animating true}]
|
||||
[icons/icon :icons/add {:color :white}])]]])
|
||||
[icons/icon :main-icons/add {:color :white}])]]])
|
||||
|
||||
(defn home-list-item [[home-item-id home-item]]
|
||||
(let [delete-action (if (:chat-id home-item)
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
[vector-icons/icon :icons/public-chat {:color colors/gray}]])
|
||||
(when private-group?
|
||||
[react/view styles/private-group-icon-container
|
||||
[vector-icons/icon :icons/group-chat {:color colors/gray}]])
|
||||
[vector-icons/icon :tiny-icons/tiny-group {:color colors/gray}]])
|
||||
[react/view {:flex-shrink 1}
|
||||
[react/text {:style styles/name-text
|
||||
:number-of-lines 1
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
[react/view {:style styles/pair-this-device-actions}
|
||||
[react/view
|
||||
[react/view (styles/pairing-button true)
|
||||
[icons/icon :icons/add (icon-style (styles/pairing-button-icon true))]]]
|
||||
[icons/icon :main-icons/add (icon-style (styles/pairing-button-icon true))]]]
|
||||
[react/view {:style styles/pairing-actions-text}
|
||||
[react/view
|
||||
[react/text {:style styles/pair-this-device-title} (i18n/label :t/pair-this-device)]]
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
:justify-content :center})
|
||||
|
||||
(defstyle profile-name-text
|
||||
{:padding-vertical 14
|
||||
{:padding-vertical 8
|
||||
:font-size 15
|
||||
:text-align :center
|
||||
:font-weight :bold
|
||||
|
@ -24,7 +24,6 @@
|
|||
(defstyle profile-three-words
|
||||
{:font-size 12
|
||||
:text-align :center
|
||||
:font-weight :bold
|
||||
:color colors/gray})
|
||||
|
||||
(defstyle profile-name-input-text
|
||||
|
@ -59,6 +58,15 @@
|
|||
:background-color colors/white
|
||||
:height 52})
|
||||
|
||||
(def settings-item-icon
|
||||
{:background-color colors/blue-light
|
||||
:width 34
|
||||
:height 34
|
||||
:border-radius 34
|
||||
:margin-right 16
|
||||
:justify-content :center
|
||||
:align-items :center})
|
||||
|
||||
(def settings-item-text-wrapper
|
||||
{:flex 1
|
||||
:flex-direction :row
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
|
||||
(defn settings-item
|
||||
[{:keys [item-text label-kw value action-fn active? destructive? hide-arrow?
|
||||
accessibility-label icon-content]
|
||||
accessibility-label icon icon-content]
|
||||
:or {value "" active? true}}]
|
||||
[react/touchable-highlight
|
||||
(cond-> {:on-press action-fn
|
||||
|
@ -82,10 +82,17 @@
|
|||
accessibility-label
|
||||
(assoc :accessibility-label accessibility-label))
|
||||
[react/view styles/settings-item
|
||||
(when icon
|
||||
[react/view styles/settings-item-icon
|
||||
[vector-icons/icon icon {:color colors/blue}]])
|
||||
[react/view styles/settings-item-text-wrapper
|
||||
[react/text {:style (merge styles/settings-item-text
|
||||
(when destructive? styles/settings-item-destructive)
|
||||
(when-not active? styles/settings-item-disabled))
|
||||
[react/text {:style (merge styles/settings-item-text
|
||||
(when destructive?
|
||||
styles/settings-item-destructive)
|
||||
(when-not active?
|
||||
styles/settings-item-disabled)
|
||||
(when icon
|
||||
{:font-size 17}))
|
||||
:number-of-lines 1}
|
||||
(or item-text (i18n/label label-kw))]
|
||||
(when-not (string/blank? value)
|
||||
|
@ -98,7 +105,9 @@
|
|||
(when (and active? (not hide-arrow?))
|
||||
[vector-icons/icon :icons/forward {:color colors/gray}]))]])
|
||||
|
||||
(defn settings-switch-item [{:keys [label-kw value action-fn active?] :or {active? true}}]
|
||||
(defn settings-switch-item
|
||||
[{:keys [label-kw value action-fn active?]
|
||||
:or {active? true}}]
|
||||
[react/view styles/settings-item
|
||||
[react/view styles/settings-item-text-wrapper
|
||||
[react/i18n-text {:style styles/settings-item-text :key label-kw}]]
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
:color colors/black}})
|
||||
|
||||
(def action-container
|
||||
{:background-color colors/white
|
||||
:padding-top 24})
|
||||
{:background-color colors/white})
|
||||
|
||||
(def action
|
||||
{:background-color (colors/alpha colors/blue 0.1)
|
||||
|
@ -47,6 +46,16 @@
|
|||
(def action-icon-opts
|
||||
{:color colors/blue})
|
||||
|
||||
(def block-action
|
||||
{:background-color (colors/alpha colors/red 0.1)
|
||||
:border-radius 50})
|
||||
|
||||
(def block-action-label
|
||||
{:color colors/red})
|
||||
|
||||
(def block-action-icon-opts
|
||||
{:color colors/red})
|
||||
|
||||
(def profile-setting-text-empty
|
||||
(merge profile-setting-text
|
||||
{:color colors/gray}))
|
||||
|
|
|
@ -16,27 +16,26 @@
|
|||
toolbar/default-nav-back
|
||||
[toolbar/content-title ""]])
|
||||
|
||||
(defn actions [{:keys [pending? public-key dapp?]}]
|
||||
(defn actions [{:keys [pending? public-key]}]
|
||||
(concat (if (or (nil? pending?) pending?)
|
||||
[{:label (i18n/label :t/add-to-contacts)
|
||||
:icon :icons/add-contact
|
||||
:action #(re-frame/dispatch [:contact.ui/add-to-contact-pressed public-key])
|
||||
:accessibility-label :add-to-contacts-button}]
|
||||
[{:label (i18n/label :t/in-contacts)
|
||||
:icon :icons/in-contacts
|
||||
:icon :main-icons/in-contacts
|
||||
:disabled? true
|
||||
:accessibility-label :in-contacts-button}])
|
||||
[{:label (i18n/label :t/send-message)
|
||||
:icon :icons/chats
|
||||
:icon :main-icons/message
|
||||
:action #(re-frame/dispatch [:contact.ui/send-message-pressed {:public-key public-key}])
|
||||
:accessibility-label :start-conversation-button}]
|
||||
(when-not dapp?
|
||||
[{:label (i18n/label :t/send-transaction)
|
||||
:icon :icons/arrow-right
|
||||
:action #(re-frame/dispatch [:profile/send-transaction public-key])
|
||||
:accessibility-label :send-transaction-button}])
|
||||
[{:label (i18n/label :t/share-profile-link)
|
||||
:icon :icons/share
|
||||
:accessibility-label :start-conversation-button}
|
||||
{:label (i18n/label :t/send-transaction)
|
||||
:icon :main-icons/send
|
||||
:action #(re-frame/dispatch [:profile/send-transaction public-key])
|
||||
:accessibility-label :send-transaction-button}
|
||||
{:label (i18n/label :t/share-profile-link)
|
||||
:icon :main-icons/share
|
||||
:action #(re-frame/dispatch [:profile/share-profile-link public-key])
|
||||
:accessibility-label :share-profile-link}]))
|
||||
|
||||
|
@ -61,6 +60,22 @@
|
|||
[react/view
|
||||
[profile-info-contact-code-item public-key]])
|
||||
|
||||
(defn block-contact-action [{:keys [blocked? public-key]}]
|
||||
[list/render-action
|
||||
{:label (if blocked?
|
||||
(i18n/label :t/unblock-contact)
|
||||
(i18n/label :t/block-contact))
|
||||
:icon :main-icons/cancel
|
||||
:action (if blocked?
|
||||
#(re-frame/dispatch [:contact.ui/unblock-contact-pressed public-key])
|
||||
#(re-frame/dispatch [:contact.ui/block-contact-pressed public-key]))
|
||||
:accessibility-label (if blocked?
|
||||
:unblock-contact
|
||||
:block-contact)}
|
||||
{:action-style styles/block-action
|
||||
:action-label-style styles/block-action-label
|
||||
:icon-opts styles/block-action-icon-opts}])
|
||||
|
||||
(defview profile []
|
||||
(letsubs [identity [:contacts/current-contact-identity]
|
||||
maybe-contact [:contacts/current-contact]]
|
||||
|
@ -80,5 +95,7 @@
|
|||
:action-label-style styles/action-label
|
||||
:action-separator-style styles/action-separator
|
||||
:icon-opts styles/action-icon-opts}]
|
||||
[react/view {:style {:height 16}}]
|
||||
[block-contact-action contact]
|
||||
[react/view styles/contact-profile-info-container
|
||||
[profile-info contact]]]])))
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
(concat
|
||||
(when allow-adding-members?
|
||||
[{:label (i18n/label :add-members)
|
||||
:icon :icons/add
|
||||
:icon :main-icons/add
|
||||
:action #(re-frame/dispatch [:navigate-to :add-participants-toggle-list])}])
|
||||
[{:label (i18n/label :t/clear-history)
|
||||
:icon :icons/close
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
(:require-macros [status-im.utils.views :refer [defview letsubs]])
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.ui.components.list.views :as list.views]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.ui.components.action-button.styles :as action-button.styles]
|
||||
[status-im.ui.components.button.view :as button]
|
||||
|
@ -77,7 +78,7 @@
|
|||
[button/button-with-icon
|
||||
{:on-press #(list-selection/open-share {:message link})
|
||||
:label (i18n/label :t/share-link)
|
||||
:icon :icons/share
|
||||
:icon :main-icons/share
|
||||
:accessibility-label :share-my-contact-code-button
|
||||
:style styles/share-link-button}]))
|
||||
|
||||
|
@ -125,6 +126,7 @@
|
|||
(when show-backup-seed?
|
||||
[profile.components/settings-item
|
||||
{:label-kw :t/backup-your-recovery-phrase
|
||||
:accessibility-label :back-up-recovery-phrase-button
|
||||
:action-fn #(re-frame/dispatch [:navigate-to :backup-seed])
|
||||
:icon-content [components.common/counter {:size 22} 1]}])
|
||||
[profile.components/settings-item-separator]
|
||||
|
@ -228,13 +230,33 @@
|
|||
(when advanced?
|
||||
[advanced-settings params on-show])]))
|
||||
|
||||
(defn share-profile-item
|
||||
[{:keys [public-key photo-path] :as current-account}]
|
||||
[list.views/big-list-item
|
||||
{:text (i18n/label :t/share-my-profile)
|
||||
:icon :main-icons/share
|
||||
:accessibility-label :share-my-profile-button
|
||||
:action-fn #(re-frame/dispatch [:navigate-to :profile-qr-viewer
|
||||
{:contact current-account
|
||||
:source :public-key
|
||||
:value public-key}])}])
|
||||
|
||||
(defn contacts-list-item [active-contacts-count]
|
||||
[list.views/big-list-item
|
||||
{:text (i18n/label :t/contacts)
|
||||
:icon :main-icons/in-contacts
|
||||
:accessibility-label :notifications-button
|
||||
:accessory-value active-contacts-count
|
||||
:action-fn #(re-frame/dispatch [:navigate-to :contacts-list])}])
|
||||
|
||||
(defview my-profile []
|
||||
(letsubs [{:keys [public-key photo-path] :as current-account} [:account/account]
|
||||
editing? [:get :my-profile/editing?]
|
||||
changed-account [:get :my-profile/profile]
|
||||
currency [:wallet/currency]
|
||||
login-data [:get :accounts/login]
|
||||
scroll (reagent/atom nil)]
|
||||
scroll (reagent/atom nil)
|
||||
active-contacts-count [:contacts/active-count]]
|
||||
(let [shown-account (merge current-account changed-account)
|
||||
;; We scroll on the component once rendered. setTimeout is necessary,
|
||||
;; likely to allow the animation to finish.
|
||||
|
@ -262,15 +284,8 @@
|
|||
(profile-icon-options-ext)
|
||||
profile-icon-options)
|
||||
:on-change-text-event :my-profile/update-name}]]
|
||||
[react/view (merge action-button.styles/actions-list
|
||||
styles/share-contact-code-container)
|
||||
[button/secondary-button {:on-press #(re-frame/dispatch [:navigate-to :profile-qr-viewer
|
||||
{:contact (dissoc current-account :mnemonic)
|
||||
:source :public-key
|
||||
:value public-key}])
|
||||
:style styles/share-contact-code-button
|
||||
:accessibility-label :share-my-profile-button}
|
||||
(i18n/label :t/share-my-profile)]]
|
||||
[share-profile-item (dissoc current-account :mnemonic)]
|
||||
[contacts-list-item active-contacts-count]
|
||||
[react/view styles/my-profile-info-container
|
||||
[my-profile-settings current-account shown-account currency (nil? login-data)]]
|
||||
(when (nil? login-data)
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
[status-im.ui.screens.wallet.transactions.views :as wallet-transactions]
|
||||
[status-im.ui.screens.wallet.transaction-sent.views :refer [transaction-sent transaction-sent-modal]]
|
||||
[status-im.ui.screens.wallet.components.views :refer [contact-code recent-recipients recipient-qr-code]]
|
||||
[status-im.ui.screens.contacts-list.views :refer [contacts-list blocked-users-list]]
|
||||
[status-im.ui.screens.network-settings.views :refer [network-settings]]
|
||||
[status-im.ui.screens.network-settings.network-details.views :refer [network-details]]
|
||||
[status-im.ui.screens.network-settings.edit-network.views :refer [edit-network]]
|
||||
|
@ -310,6 +311,8 @@
|
|||
(nav-reagent/stack-navigator
|
||||
(stack-screens
|
||||
(cond-> {:my-profile (main-tabs/get-main-tab :my-profile)
|
||||
:contacts-list contacts-list
|
||||
:blocked-users-list blocked-users-list
|
||||
:profile-photo-capture profile-photo-capture
|
||||
:about-app about-app/about-app
|
||||
:bootnodes-settings bootnodes-settings
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
[wallet.components/toolbar {}
|
||||
wallet.components/default-action
|
||||
(i18n/label :t/receive)
|
||||
[toolbar/actions [{:icon :icons/share
|
||||
[toolbar/actions [{:icon :main-icons/share
|
||||
:icon-opts {:color :white
|
||||
:accessibility-label :share-button}
|
||||
:handler #(list-selection/open-share {:message address-hex})}]]]
|
||||
|
|
|
@ -175,11 +175,14 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
|
|||
chat_element.find_element()
|
||||
username = chat_element.username.text
|
||||
chat_element.member_photo.click()
|
||||
for element in [chat_1.contact_profile_picture, chat_1.add_to_contacts, chat_1.profile_send_message,
|
||||
chat_1.profile_send_transaction, chat_1.profile_address_text,
|
||||
for element in [chat_1.contact_profile_picture,
|
||||
chat_1.add_to_contacts,
|
||||
chat_1.profile_send_message,
|
||||
chat_1.profile_send_transaction,
|
||||
chat_1.profile_address_text,
|
||||
chat_1.element_by_text(username, 'text')]:
|
||||
if not element.is_element_displayed():
|
||||
self.errors.append('%s is not visible' % 'user name' if 'Base' in element.name else element.name)
|
||||
if not element.scroll_to_element():
|
||||
self.errors.append('%s is not visible' % element.name)
|
||||
chat_1.add_to_contacts.click()
|
||||
if not chat_1.element_by_text('In contacts').is_element_displayed():
|
||||
self.errors.append("'Add to contacts' is not changed to 'In contacts'")
|
||||
|
|
|
@ -181,6 +181,11 @@ class BackupRecoveryPhraseButton(BaseButton):
|
|||
super(BackupRecoveryPhraseButton, self).__init__(driver)
|
||||
self.locator = self.Locator.text_selector('Backup your recovery phrase')
|
||||
|
||||
def click(self):
|
||||
self.scroll_to_element().click()
|
||||
self.driver.info('Tap on %s' % self.name)
|
||||
return self.navigate()
|
||||
|
||||
|
||||
class OkContinueButton(BaseButton):
|
||||
|
||||
|
|
|
@ -876,6 +876,12 @@
|
|||
"share-chat": "Share chat",
|
||||
"share-link": "Share link",
|
||||
"share-profile-link": "Share profile link",
|
||||
"add-contact": "Add contact",
|
||||
"blocked-users": "Blocked users",
|
||||
"block-contact": "Block contact",
|
||||
"unblock-contact": "Unblock contact",
|
||||
"to-block": "Block",
|
||||
"block-contact-details": "Blocking will delete all of this user previous messages and stop new ones from reaching you",
|
||||
"share-public-chat-text": "Check out this public chat on the Status app: {{link}}",
|
||||
"share-dapp-text": "Check out this DApp I'm using on Status: {{link}}",
|
||||
"network-invalid-url": "Network URL is invalid",
|
||||
|
|